Logout only if logged in.