Rescuing and repairing broken connections

* Resets the socket and reestablishes the connection on SSLError or
Errno::EPIPE
* Logs error occurrences with socket state for further investigation.
Merge pull request #38 from freeatnet/self-repairing-connections

Rescuing and repairing broken connections