[runtime] Avoid calling mono_thread_current () in sgen_thread_detach (), since it can construct objects. Fixes #19755.