integcli: fix race in runCommandWithStdoutStderr

This PR should fix or at least make it easier to debug failing tests. There was a race in runCommandWithStdoutStderr.
I've made the change. PTAL