Fix eckey_priv_encode()

Fix eckey_priv_encode to return an error on failure of i2d_ECPrivateKey.