monkey-patch select, thread and time

To avoid blocking on connection errors, retries and I/O
delays.
Merge pull request #332 from hmakkapati/monkey_patch

monkey-patch select, thread and time