Properly savestate loaded modules.

May fix savestates in games that use modules heavily, like Yu-Gi-Oh, Metal
Gear Solid, Tales of Radiant Mythology, and Valkyrie Profile.
Merge pull request #5176 from unknownbrackets/savestates

Properly savestate loaded modules