__try_read_sock: also check errno if read returns 0

In some cases (and notably FreeBSD), a read() on a socket which doesn't
have data ready sets errno but returns 0.  This confuses the library
into thinking that we hit an end-of-file because the server closed the
connection.

Therefore, we need to check errno even when read() returns 0; in
particular, EAGAIN means read() returned no data, but the socket is
still alive and should not be closed.
Merge pull request #75 from xtab/master

__try_read_sock: also check errno if read returns 0