Implement client timeout

Realization of issue #73. When a socket times out and no other
errors have occured yet, callback will be called with an error.