Fix for MemorizingTrustManager and WebSockets

Previous fix for Looper issues caued a new issue when using the
certificate trust dialog (network on main thread exception).
Moved the WebSocket connection into a HandlerThread instead, which
automatically prepares/quits the Looper and also allows the MTM
to work properly.