Refactors signal_thread_inherit() to be called from a new routine os_thread_init_finalize() which is invoked while holding thread_initexit_lock yet after synch_thread_init(). This eliminates races with suspend signals arriving in newly half-initialized threads, which then drop the signals. The refactoring rearranges several thread initialization sequences to pass the clone record through dynamo_thread_init().
This refactoring allows us to revert the os_thread_suspend timeout from commit 972cddfa PR #2762 which added a timeout to os_thread_suspend that turns out to not be safe on UNIX as the suspend model assumes there is no retry.
Delays mask relaxing in handle_suspend_signal() to avoid timeout on suspend due to an intervening signal.
Includes tweaks to an i#3020-related assert and i#2993-related alarm lock retry which got in the way of testing the final solution here.
Tested by running thread creating apps that attach and detach many times, similar to the static burst tests in our suite.
Issue: #3020, #2993 (closed) Fixes: #2779 (closed)