PeekChar2
Implements ISO's peek_char/2: unifies the second argument with the next character of the input stream identified by the first (an alias or $stream(...) term) without consuming it, as end_of_file at end of stream.
Throws
if the first argument is unbound.
if it does not identify an open channel.
(stream_type) if it identifies an output channel instead.
(in_character) if the second argument is bound to something other than end_of_file or a one-character atom.
Fails, rather than erroring, if the channel is closed.