[threads] Make mono_thread_detach_internal static (#5241)