Getting children PIDs before the main process is killed