check all socket reads and return value on error

CDRIVER-199 Socket reads not checked for IO errors, e.g. timeouts