When looking for the GPG-Agent's socket, call gpg-connect-agent
as a fallback method. This will have the side-effect of launching
the agent if it was not already running (if the agent is configured
to use a standard socket, which is always the case with GnuPG 2.1).
Add a boolean parameter to indicate whether pinentry environment
variables should be passed to the agent.
Setting this parameter to a non-zero value is equivalent to
calling the init_agent_environment function one the connection
with the agent is established.
If the key is to be read from a read-protected DO, ensure that
the appropriate PIN is checked before attempting to read it. If
the PIN has not been previously verified, the GPG Agent will then
take care of it.