Fix implementation of ssh-agent module

- improve checking for currently-running agent

- don't write the _ssh_agent_env file if agent already running