Fix possible missing unlock of env_lock
Add check to avoid usage of broken LuaJIT < 2.0.0beta8
Merge branch 'master' of https://github.com/minetest/minetest