Try to fix Bug 23991
Note that we can not deregister in ~MemoryManager since some compiler runtime implementations (e.g. libgcc) would access memory content during deregisteration, but some of the MemoryManager implementations (e.g. SectionMemoryManager) would unmap all the memory sections in dtor.
This bug was also found when Pony programming language try to upgrade to LLVM 9.x.