Fix PGP unit tests

gpg version 1.4.11 (and maybe others) skips private keys without public
keys when listing keys.

To avoid this scenario in the tests, add the public key immediately after
adding the private key.