Add a signal handler for SIGALRM at shutdown time to print thread traceback
Description
This MR adds a 20 second alarm clock at shutdown time. When the SIGALRM is received (ie. shutdown has taken more than 20 seconds), the currently running threads are enumerated and their current stack traces are dumped to stderr.
This should enable more detailed debugging of hung threads at shutdown time.