Refactor startThreadedConnectLoop
Interrupt current RelayConnection on connect

* Use SocketChannel, which can be interrupted.
* Always interrupt the connector thread on disconnect if it's running.
* Fixes a bug on slow connections, or firewalls that drop packets, where
  an infinite number of connections will be created in the connect loop.
Only connect if network is available
Close SSH connection on disconnect
Disable DEBUG_NOTIFICATIONS
Implement ping command
Preferences for ping
Sleep before ping, not after
Don't send ping if we've received data recently
Interrupt pageWriter on disconnect
Use ScheduledExecutorService to send relay pings
Refactor PongHandler

* Use synchronized methods to simplify wait/notify.
* AtomicLong use now unnecessary due to synchronization.
* Fix bug where waitForPong may wait longer than timeout.
Refactor LastMessageHandler