Fix handling of encrypted keys.

If encrypted keys are present they will be found before checking
ssh-agent for keys. Since we don't want to enter passwords into random
scripts it's better to get the key from the agent.