native: Use static destructor to free native modules registry
Valgrind shows that the string keys used to register native modules are leaked. (Valgrind must have gotten better at detecting this, in recent versions.) The simplest solution is to change the static GHashTable (which must be freed at end of process) to a static std::unordered_map (which will have its destructor called automatically at end of process.) Static destructors can be tricky, but the only things being freed here are std::string keys, so there should not be any ordering dependencies between this and any other static destructors.
Showing with 14 additions and 25 deletions