Fix EVP_PKEY_CTX_dup() to return correct value and handle NULL keys in