avoid doing a stream_select on a closed stream