base/lua: updates to be compatible with both Lua 5.2 and Lua 5.1