OnStop: disconnect client only if it's connected