Currently signal_post_select() kills all child processes and then
calls exit(3) if SIGNINT or SIGTERM was received. This leaves all file
descriptors open and memory blocks allocated, which makes debugging
memory leaks difficult because the valgrind output is hard to read.
This patch changes the server to cleanly shutdown the scheduler and
deallocate resources (close file descriptors, free memory, destroy
locks and shared memory areas) before exit(3) is called.