operate correctly if __index is a table

strict.lua does not appear to work when sourced in openresty, presumably as the _G metatable __index is defined in C in openresty. 

NB: checking the type of old_index inside the __index function results in a stack overflow, so we have to read the type prior to entering the function we're defining for __index.