MDL-64359 core: Respect shutdown handlers on SIG