Fixed sock_read().

Finally, after quite a number of years, I finally fixed the sock_read()
function to work OK. Now we spin-read data from the socket, and only
wait when there's no data available. Also, connection_read() may
return a short read count and NOT treat that as an error.

Note that for some obscure reason the read socket has been blocking
for years. WTF? This commit changes it to nonblocking.