Initialize the secret key to NULL

If you pass a keyid and the keyid is not that of a secret key then it
will not set the key. In this case it checks it against NULL. However,
`key` must be NULL initially for this to work.
Support offline master keys

We previously searched for secret keys, which ignores secret subkeys.
Instead we now search all keys in the keyring, skipping those that
cannot sign (also those that are revoked, expired, disabled, or
invalid). The result is that the user can specify the master keyid even
if their master key is offline but they have a usable signing subkey.