pubsub: fix race condition in fake server
pubsub: fix race condition in fake server

fakeServer.wait should wait for all outstanding calls to StreamingPull
to finish, in addition to waiting for an internal goroutine to finish.

The race condition was:

1. Client calls StreamingPull for a new stream, then Send.
2. Server completes the Recv at the top of fakeServer.StreamingPull.
3. Client Send finishes. Receive exits immediately (perhaps context is canceled).
4. Client calls fakeServer.wait, which calls Wait on the fakeServer's WaitGroup.
5. Server starts the goroutine about 10 lines after the Recv, calling Add
   on the WaitGroup.
6. The WaitGroup panics because Add was called while Wait was in progress.

Change-Id: I06b93eb65507e21d8a9072c7944889ca3fb9234f
Reviewed-on: https://code-review.googlesource.com/14610
Reviewed-by: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>
Reviewed-by: Michael Darakananda <176c4818757ce942f02114959cee75d35f2575d9@google.com>

googleapis/google-cloud-go,googleapis/google-cloud-go,googleapis/google-cloud-go,googleapis/google-cloud-go