global()
When we add threads it's not actually valid to have a global cache as the index is only valid on one thread! Instead let's use a per-thread cache using `thread_local!` which compiles to basically the same code as before for single-threaded wasm.