Implement ping command
Preferences for ping
Sleep before ping, not after
Don't disconnect if we're already disconnected

* The connected boolean reflects application state; the socket may
  already be closed.