Check if the pipe array is empty before calling stream_select()