Make engine_pkey_meths_free & engine_pkey_asn1_meths_free optional

These patches fix the issue https://github.com/openssl/openssl/issues/25
It 
 * adds two ENGINE_FLAGS to  make engine_pkey_meths_free and engine_pkey_asn1_meths_free optional
 * unregisters the engines registered ciphers/digests/... before destroying the engine
 * adds reference counting to gost, so gost can keep track of resources on his own