database/sql: check for arg counts after eliminating arguments
database/sql: check for arg counts after eliminating arguments

Check for the expected number of arguments in a SQL statement
after arguments are eliminated in the argument converter.

This situation was already tested for in TestNamedValueChecker.
However the test used Exec which didn't have any check for
NumInput on it at all, thus this issue was never caught.

In addition to moving the NumInput check on the Query
methods after the converter, add the NumInput check
to the Exec methods as well.

Fixes #22630

Change-Id: If45920c6e1cf70dca63822a0cedec2cdc5cc611c
Reviewed-on: https://go-review.googlesource.com/76732
Run-TryBot: Daniel Theophanes <14db39248b80c6688f7e9808ba5055f2e56426f3@gmail.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>

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