use sync.WaitGroup to wait for stdout and stderr to finish before callin...

...g cmd.Wait()