Check whether read stream is empty before calling stream_select()

Fixes "stream_select(): No stream arrays were passed in" warning