Add timeout to the socket connection.
Fix #6 when the async client process is killed.