Fix attach_thread to allocate a TLS index for *gc-inhibit* if needed