Fix Lua stack overflow

When passing many arguments or returning many values from PHP→Lua,
lua_checkstack was not being called so the Lua stack could easily
overflow.

Bug: 49705
Change-Id: Ic5f619eeb620c2a4a9fb2cbc7e75249c0db1a187