Locks ssh-agent in response to system events.