Shutdown subprocesses before waiting.