Fix pid 1 deadlocking when exiting with children.
The child processes of pid 1 were being reparented to pid 1, causing an infinite loop. This change fixes the problem by adding a hook that runs in the last thread about to exit in a process. When pid 1 exits, the hook will prevent more processes and threads from being created, and then broadcast kill all processes and threads. The hook is not run in LastPrayer(), as that function runs in a worker thread and it can't block waiting for another thread to run LastPrayer() in the same thread.
Showing with 103 additions and 12 deletions