Fixed connection leaks on errors
Ensured the worker process gets exited on timeouts
Added configurable socket options
Merge pull request #1 from alertlogic/fix-connection-closing

Fixed resource leaks due to errors