internal/pubsub: replace channel with mutex (#780)
internal/pubsub: replace channel with mutex (#780)

Since the `sem` field is no longer being used in a select statement,
replace it with a mutex.

Previously it was used in a select statement along with ctx.Done, but
that was actually buggy because if both channels were available, sem
might get chosen even though Receive should return immediately on
ctx.Done.

Also rewrote the select with ctx.Done to just check for non-nil
ctx.Err, which is equivalent and simpler to write.
google/go-cloud,google/go-cloud,google/go-cloud