make-flexi-stream: Better error when stream is not an input or output stream.