Make socket.send() not raise a SIGPIPE.
Handle socket.send()/socket.recv() errors more robustly.

Also handle errors the ssl module throws at us.