Fix for BIO_get_mem_ptr and related regressions