Attempt to solve the problem with malloc/free overrides properly where I used a workaround before.

Apparently for an unknown reason the first "dlsym" call inside the first "free" call now itself calls free.
This caused infinite recursion and a crash when USE_GLIBC_MALLOC_OVERRIDE was defined.
I'm not completely confident yet that this solution is clean...