Properly Close Inventories

Properly close inventories when unloading and switching worlds.