Catch socket errors

Catch socket errors where they occur (during use of the XML-RPC connection, not when the connection is initiated).