Fix a nullptr in KeychainProvider

Fixes #589