Add checks to verify correctness of RSA/DSA/ElGamal keys

When the various components are assembled into an RSA,
DSA or ElGamal key via the construct() method, we must verify
as much as possible if the result is indeed a valid key.
FIX #1193521: mpz_powm_sec crashes when modulus is odd

When importing a key, we verify that all components
that will be used as modulus for mpz_powm_sec() are odd.
Use mpz_powm_sec() only when needed.

mpz_powm_sec() is useful when exercising the private key
(signature or decryption).

When the public key is used or when the input is random
and produced locally, there is no real need for it.