Allow lua `debug.sethook` when compiled --with-debug

Luajit needs xcflag set as a compile option to allow setting `debug.sethook`
Merge branch 'master' into enable-checkhooks
merge with master moving the sethooks option out of debug