Add better error checking for waitpid in tids_sweep_procs