Fix exception propagation and some error handling related to the privatekey passphrase callback.