Pull detection of being in a shutdown hook into utility function.