database/sql: consolidate test polling loops
database/sql: consolidate test polling loops

Also eliminate some arbitrary deadlines and sleeps.

Fixes #49958

Change-Id: I999b39a896e430e3bb93aa8b8c9444f28bbaa9d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/378395
Trust: Bryan Mills <1c8aad60184261ccede67f5c63a0d2a3bf3c9ff4@google.com>
Run-TryBot: Bryan Mills <1c8aad60184261ccede67f5c63a0d2a3bf3c9ff4@google.com>
TryBot-Result: Gopher Robot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Daniel Theophanes <14db39248b80c6688f7e9808ba5055f2e56426f3@gmail.com>

cloudflare/go,nawawi/go,golang/go,golang/go,CAFxX/go,golang/go,cloudflare/go,nawawi/go,cloudflare/go,golang/go,nawawi/go,nawawi/go,cloudflare/go,nawawi/go,nawawi/go,nawawi/go,CAFxX/go,cloudflare/go,golang/go,CAFxX/go,CAFxX/go,nawawi/go,cloudflare/go,CAFxX/go,golang/go,cloudflare/go,CAFxX/go,golang/go,golang/go,CAFxX/go,CAFxX/go,cloudflare/go