Sets the signal handler for the 3 alarm signals to SIG_IGN during attach and detach, to reduce problems with races while we try to coordinate taking over or sending native all of the app threads.
This is not a panacea, as timer_create can send out any signal, not just the 3 classic alarm signals, on timer expiration. Plus, non-timer-related signals could arrive during attach or detach. However, this will help with the most typical cases.
Adds an itimer to the api.static_signal test, though it is not easy to reproduce these problems in small applications.
I'm considering this to fix the filed issues despite the above-mentioned remaining corner cases as I'm considering those to be pathological:
Fixes #2161 (closed) Fixes #2270 (closed)