EC key storing: make sure algorithm params are available

When trying to import EC keys onto the card with pkcs15-init, the
params.ec of sc_pkcs15init_prkeyargs or pubkeyargs had not been
initialized. This commit fixes that by reading the curve name from the
EVP_KEY and initializing the parameters.

Also, in sc_pkcs15_encode_pubkey_as_spki, this commit adds code that
tries to construct the EC algorithm params from the key itself. This
prevents a NULL parameter in the SPKI/ASN1 encoding.