refactor killing of child processes to one function, and add exception wrapper, since it is possible something else killed it