add MemoryLeakDetectorLock to allow thread-safe memory leak detector