Improved handling of errors returned from gpg
Force-unlock the signature key before signing

Previously if a user was not under X and had a gpg-agent that
had not already unlocked the key it would not be able to prompt the
user for the password. gpgpwd now performs a mock-signing before
performing the actual signing to make sure that the key is unlocked.
Added tests for operation when using a broken gpg
Fixed GNUPGHOME env check
Properly handle broken gpg-agent processes