[Fix #689] Use GPG_AGENT_INFO instead of GPG_AGENT_PID

GPG_AGENT_PID may not be defined. Also, source gpg-agent.env before
checking the PID.
Merge remote-tracking branch 'upstream/master'