NPCs from mods getting removed if mod order was changed

Steps to reproduce:

  1. Install any mod with an NPC.
  2. Move the NPC to another cell (for example attack and run away).
  3. Save game.
  4. Change mod order (the mod with the NPC should now have another index)
  5. Load game. The NPC is missed. Log contains a message like Warning: Dropping moved ref test_npc for 1 (moved object no longer exists)

Changed load order is handled here, but this functionality is broken.