Another attempt at PRELOADing mmalloc (WIP)
Try to have mmalloc both in the simgrid library (for the regular use)
and also as an external library that can be LD_PRELOADed before
sthread too.
We'll have two copies of the library when actually preloading it in
sthread, but in this case, we use dlsym(RTDL_NEXT) to find the first
loaded symbol in memory to have only one mheap in the process.
It still segfault when launching a sthread code within simgrid-mc as
follows:
bin/simgrid-mc --cfg=model-check/setenv:LD_PRELOAD=lib/libsgmalloc.so:lib/libsthread.soexamples/sthread/pthread-mutex-simple
but at least it should fix the breakage found on FreeBSD.