Spigot's patch: Properly close inventories when unloading and switching worlds.

For fix dupes with minecarts.