Fixed sock_read bug when returning 0 values on Windows.

sock_read on Windows returns 0 when an error occurs.