Update set_mapgen_params and set_gen_notify Lua API to use new flag format
Fix race condition on exit to menu
Update ABM object counts when triggers add objects

Also fixes long-standing accuracy issue due to unknown wider
object count not being incremented.
Correct misleading detached inventory error message

Looks like a bit of hasty copying and pasting from s_item.cpp.
Merge remote-tracking branch 'minetest/master'

Conflicts:
	src/environment.cpp
	src/game.cpp