Check for available data on the socket before trying to read it