lua: use lua_Integer when appropriate
This avoids potential information loss when converting size_t to lua_Integer by not converting to int in between.
This avoids potential information loss when converting size_t to lua_Integer by not converting to int in between.