Add Lua stack size debug output macro
Move memory allocation to after exception-risking call

Also: Add more Lua stack asserts to the same code.