fix stack-alloctors and singletons used in muthithreaded apps