Refactor: daemons: Create a function for find_and_track_existing_processes
The innermost loop of that function can now be its own function, which
makes for much simpler looking code. Unfortunately it doesn't lend
itself well to using the for_each_child wrapper due to the variety of
return codes involved.