Optimizing MCJIT module state tracking

Patch co-developed with Yaron Keren.