Fixed all the memory leaks in LightTest via DebugMem.