src: fix race on modpending by migrating it to a thread local
Fixes a rare race condition on modpending
when two native modules are loaded simultaneously on different threads by migrating modpending
to be a thread local.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows [commit guidelines]