gracefulswitch: Wait for all goroutines on close (#8746)
Goroutines spawned during balancer swaps could outlive the call to
Balancer.Close(). Monitor these via a wait group and wait for them to
finish before returning from Close(). This prevents any noticeable side
effects that could otherwise occur after Close() returns.
See:
* #8655
* https://github.com/grpc/grpc-go/pull/8666#issuecomment-
3604119490
RELEASE NOTES:
- client: Closing a graceful switch balancer will now block until all
pending goroutines complete.
Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>