libc -- dmalloc: Call malloc_init as-needed, rather than via cc constructor.
dmalloc requires its own _nmalloc_thr_init be called before it can service
allocations. Applications with preinit arrays were able to call malloc before
constructors ran, which caused them to crash on uninitialized allocator state.
The change uses a flag to test for allocator init state. It is also careful
to not allow _nmalloc_thr_init to be called recursively from within pthread
initialization (slglobal.masked).
Reported-by: marino@
Closes-bug: 2305