Fix a binary compatibility issue with the size of the EVP_MD_CTX struct.

OpenSSL 0.9.x vs OpenSSL 1.0.x uses a different struct definition, which
will cause problems if the ssl libraries are dynamically loaded, and if
the application is built against 0.9 and run against 1.0.

http://bugs.python.org/issue21564 details the same issue in python's
hashlib extension.

Instead of declaring the EVP_MD_CTX struct directly as a stack variable,
use the provided API functions to allocate and deallocate instances.