Auto-reconnect mechanism for the SSH tunnel.