database/sql: do not leak the connectionResetter goroutine
database/sql: do not leak the connectionResetter goroutine

Before terminating the connectionResetter goroutine the connection
pool processes all of the connections on the channel to unlock the
driverConn instances so everthing can shutdown cleanly. However
the channel was never closed so the goroutine hangs on the range.
Close the channel prior to ranging over it. Also prevent additional
connections from being sent to the resetter after the connection
pool has been closed.

Fixes #22699

Change-Id: I440d2b13cbedec2e04621557f5bd0b1526933dd7
Reviewed-on: https://go-review.googlesource.com/77390
Run-TryBot: Daniel Theophanes <14db39248b80c6688f7e9808ba5055f2e56426f3@gmail.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>

codestation/go,golang/go,golang/go,akutz/go,christopher-henderson/Go,cloudflare/go,Cofyc/go,golang/go,cloudflare/go,Cofyc/go,josharian/go,josharian/go,Cofyc/go,codestation/go,Cofyc/go,golang/go,nawawi/go,akutz/go,codestation/go,Cofyc/go,codestation/go,akutz/go,Cofyc/go,Cofyc/go,codestation/go,akutz/go,akutz/go,CAFxX/go,josharian/go,akutz/go,CAFxX/go,golang/go,josharian/go,Cofyc/go,CAFxX/go,cloudflare/go,cloudflare/go,CAFxX/go,golang/go,codestation/go,codestation/go,josharian/go,nawawi/go,nawawi/go,nawawi/go,akutz/go,golang/go,josharian/go,josharian/go,nawawi/go,josharian/go,golang/go,cloudflare/go,nawawi/go,cloudflare/go,CAFxX/go,CAFxX/go,cloudflare/go,CAFxX/go,akutz/go,codestation/go,cloudflare/go,nawawi/go,CAFxX/go,nawawi/go