Fix SSL handshake event processing.

Do not try to use IOLoop to handle socket events.
Poll for events using select.
Catch socket timeout exception.
Remove unused class variable DO_HANDSHAKE.