sweet/benchmarks/internal/pool: use errgroup to manage errors and cancellation

Also simplify concurrency in TestPoolCancel: t.Fatalf was called in a
background goroutine, which is not allowed (because it invokes
runtime.Goexit), but the background goroutine isn't really necessary
anyway. (If the test deadlocks, it's more useful to just let it time
out anyway so that the test will give us a useful goroutine dump.)

Fixes golang/go#50096

Change-Id: Ica9abf427f662f4ed1f7cd64ef906b49744009ef
Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/370974
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
4 files changed