Fix clients timeout handling.

During the refactoring of blocking operations, commit
82b672f6335ac2db32a724ba5dc10398c949a4a8, a bug was introduced where
a milliseconds time is compared to a seconds time, so all the clients
always appear to timeout if timeout is set to non-zero value.

Thanks to Jonathan Leibiusky for finding the bug and helping verifying
the cause and fix.