Fix segfault when built with OpenSSL >= 1.0.1

This commit fixes a segfault encountered when using ext/openssl with OpenSSL >= 1.0.1.