Perform an OPENSSL_cleanup before checking the heap in our memleak tests (#4293)

* Perform an OPENSSL_cleanup before checking the heap in our memleak tests

* Make this binding conditional

* typo

* need to put this call before we reset the function ptrs
3 files changed