Add PR_SET_PDEATHSIG to ensure watcher process terminates when parent dies
This change ensures that on Linux systems, if the parent Python process dies unexpectedly, the kernel will automatically send SIGTERM to the watcher process, preventing it from becoming a zombie process.
SIGTERM doesn't prevent processes from becoming zombies. The Unix process model is counterintuitive, though it has an internal logic. The point of a zombie process is that whenever a process exits, the kernel keeps the PID reserved (to prevent race conditions) and keeps a bit of memory to hold the exit status, until the parent process "reaps" the zombie = tells the kernel that it's OK to forget about the exit status and re-allocate the PID to a new process. So every way of process exiting always creates a zombie; they always have to be reaped.
Is it actually zombie processes that are causing problems? Or is perpetuo failing to exit in the first place?