Extract derived constants from nm output for various OSes differently.

Fixes #8783.

In order to avoid querying the nm version that does not work on Mac OS X
we use the "nm -P" output that is supposed to produce (more portable)
POSIX output and works on all tested OSes (MinGW, Mac OS X, Solaris and
Linux using GNU nm) although slightly different (as documented). The "nm
-P" output is actually only needed to recognize the output of a non-GNU
Solaris nm (all other OSes produce sane outut using "nm" only).

Signed-off-by: Austin Seipp <austin@well-typed.com>
Add missing stack checks to stg_ap_* functions (#9001)

(cherry picked from commit fc0ed8a7309e7cc863b8155fae6b57cb23331c44)

Conflicts:
	testsuite/tests/codeGen/should_run/all.T
Only uninstall signal handlers if they were actually installed (#9068)

Submitted by: tomgr

(cherry picked from commit bc7d49a658a516679cc264502e72560c1d2c2314)
rts: remove stable-names from hashtable upon free

This fixes #9078.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit b75d126e779e8690c675be84e8972dc023e04b9b)
Fix missing unlockClosure() call in tryReadMVar (#9148)

(cherry picked from commit 96a95f0513de785a185fd8a46c7ed2643f698295)