Fixed sock_read bug when returning 0 values on Windows.

On windows, sock_read returns 0 when an error reading occurs.