fix #550: handle socket read timeouts properly