Add minetest.register_on_joinplayer and minetest.register_on_leaveplayer, make adding new callbacks to scriptapi.cpp easier by adding scriptapi_run_callbacks, also fix a minor bug with PlayerSAO <-> singleplayer mode interaction