Tools/mmap_generator: Fixed a deadlock at exit