Handle registers the onShutdown function to be run when the system is being
shut down. On shutdown, registered functions are run in last-in-first-out
order. Handle may be called concurrently.
Now calls all registered shutdown closures in last-in-first-out order and
terminates the process with the given status code.
It only executes once and guarantees termination within GracePeriod.
Now may be called concurrently.