database/sql: let tests wait for db pool to come to expected state
database/sql: let tests wait for db pool to come to expected state

Slower builders were failing TestQueryContext because the cancel
and return to conn pool happens async. TestQueryContext already
uses a wait method for this reason. Use the same method for
other context tests.

Fixes #18759

Change-Id: I84cce697392b867e4ebdfadd38027a06ca14655f
Reviewed-on: https://go-review.googlesource.com/35750
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>
Run-TryBot: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>

akutz/go,cloudflare/go,ImJasonH/go,polyverse-security/go,polyverse-security/go,Cofyc/go,josharian/go,ImJasonH/go,nawawi/go,vsekhar/elastic-go,ImJasonH/go,golang/go,nawawi/go,codestation/go,akutz/go,vsekhar/elastic-go,cloudflare/go,Cofyc/go,cloudflare/go,Cofyc/go,polyverse-security/go,josharian/go,linux-on-ibm-z/go,akutz/go,derekmarcotte/go,CAFxX/go,vsekhar/elastic-go,nawawi/go,ImJasonH/go,ImJasonH/go,vsekhar/elastic-go,Cofyc/go,derekmarcotte/go,derekmarcotte/go,vsekhar/elastic-go,codestation/go,polyverse-security/go,CAFxX/go,codestation/go,ImJasonH/go,cloudflare/go,CAFxX/go,nawawi/go,CAFxX/go,nawawi/go,linux-on-ibm-z/go,derekmarcotte/go,akutz/go,golang/go,linux-on-ibm-z/go,akutz/go,CAFxX/go,cloudflare/go,linux-on-ibm-z/go,codestation/go,vsekhar/elastic-go,Cofyc/go,derekmarcotte/go,josharian/go,vsekhar/elastic-go,akutz/go,cloudflare/go,derekmarcotte/go,josharian/go,cloudflare/go,Cofyc/go,josharian/go,polyverse-security/go,ImJasonH/go,CAFxX/go,linux-on-ibm-z/go,vsekhar/elastic-go,christopher-henderson/Go,CAFxX/go,golang/go,codestation/go,linux-on-ibm-z/go,golang/go,golang/go,nawawi/go,polyverse-security/go,golang/go,derekmarcotte/go,linux-on-ibm-z/go,josharian/go,codestation/go,derekmarcotte/go,ImJasonH/go,golang/go,Cofyc/go,polyverse-security/go,cloudflare/go,akutz/go,nawawi/go,akutz/go,Cofyc/go,codestation/go,josharian/go,polyverse-security/go,CAFxX/go,linux-on-ibm-z/go,codestation/go,nawawi/go,golang/go,josharian/go