[runtime] A thread without a domain set cannot be running managed code. Fixes #16794.