ensuringArgumentIsChannel
Ensures the argument at index denotes an already-open Channel, resolved either by alias (a bound atom registered in the context's input or output channels) or by $stream(...) term, as required by predicates taking a Stream_or_alias argument (e.g. close/1, stream_property/2's subject).
Throws
if it is unbound.
(source_sink/stream) if it names an alias or a stream term for which no channel is currently open.
(stream_or_alias) if it is neither an atom nor a $stream(...) term.