Shift error handling to WebSocket.

Keeps the Thread creation in Socket a little cleaner. And there's now a short sleep call - otherwise, five failures can happen too quickly (though only when logging is disabled).