[merp] Introduce a new 'dump mode' that allows different signal behavior when dumping (mono/mono#17537)
* dump_native_stacktrace should always register the sigterm handler.
Cherry picked from the https://github.com/mono/mono/pull/17310
* [merp] Introduce a new 'dump mode' that allows different signal behavior when dumping
The primary reason for this is gaining the ability to interpret SIGTERM properly as a crashing signal when outside of 'dump mode', and as a utility signal during the 'thread summarizer' dumping process.
Commit migrated from https://github.com/mono/mono/commit/
db568c6fe0cb5eab71ed729ec5b412365eacf280