lua: fix crash on stack overflow: call lua_pop() for values returned by lua functions (bug #38510)