database/sql: fix TestPendingConnsAfterErr
database/sql: fix TestPendingConnsAfterErr

TestPendingConnsAfterErr showed a failure on slower systems.
Wait and check for the database to close all connections
before pronouncing failure.

A more careful method was attempted but the connection pool
behavior is too dependent on the scheduler behavior to be
predictable.

Fixes #15684

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

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