add OpenSSL mutex hooks in thread module
fix new OpenSSL mutex code on OS X