Add an option to do the wait for termination after sending the stop commands

This means that you can send the commands at the start of the parent processes shutdown procedure and wait for them at the end,
Indeed. Not perfect. But tolerable for now, I think.