fix a synchronization bug in TestInstanceComm

We must ensure that all errors are reported before the test function
returns, so it has to wait for the reponse goroutine to finish reporting
its error, if any.