Create a ensureProcessesHaveStopped helper