overriding openssl mem_functions should be done before library init
Added check for case where our pool may return NULL, we then simply redirect to system malloc