Don't just report which script error occurred, but which in which input of which transaction,
and which UTXO was being spent.
This is a partial backport of core#31112
https://github.com/bitcoin/bitcoin/pull/31112/commits/7b267c034fdc2c8cb964a763f182ff98a75ba2ac
Also revert a temporary hack in checkqueue.h that was needed to work around a GCC 12 bug.
Depends on D18877
