gpg: Properly handle legacy keys while looking for a secret key.