Fix assert on unhandled SIGSEGV (#47538)
When SIGSEGV is not handled by .NET runtime (e.g. when it occurs in code
out of its control), the SIGSEGV handler ends up calling
DiagnosticServer::Shutdown in the runtime via a registered shutdown callback.
That method ends up calling Thread::GetFrame, which asserts if the
current SP is out of a valid range for the regular stack. The problem is
that SIGSEGV handler is called on an alternate stack and so this
callback ends up being called on that stack too. That causes this
assertion to fail, because the current thread is not marked as executing
on alternate stack, which would skip that assert.
This change fixes it by passing through a bool flag indicating whether
the callback was called on an alternate stack or not. And in that
callback, we set the flag on the thread accordingly.