std.Thread: mask all signals before unmapping stack

As the comment explains, if a signal were to arrive between a detached
thread's `munmap` and `exit` calls, the signal handler would immediately
trigger SIGSEGV due to the stack being unmapped. To solve this, we need
to block all signals before entering this logic. The musl implementation
which this logic was ported from does this exact thing; that logic was
just lost when porting.

Notably, this would lead to a crash with no stack trace, because the
SIGSEGV handler would itself crash due to the missing stack.
073ef0f393Matthew Lugg committed on 1/6/2026, 11:15:33 AMparent1111655
1 file changedLine totals unavailable