crypto: Clear error after DiffieHellman key errors

Fixes #5499