Avoid using LuaJIT internals when possible.

LuaJIT v2.1 has just added ffi.typeinfo, meaning that reflect.typeof can now be implemented without needing to pluck from internal data structures (reflect.getmetatable still needs the internals, as does reflect.typeof on older versions of LuaJIT). Because of this change, internal data structures are only plucked-from when first needed.