Split out of #34132 (review).
Problem
We have two ways to check if a coin exists in the db.
One tries to deserialize, the other just returns whether any value is associated with the key.
But we usually need the full value we probed for, and HaveCoin cannot cache the returned value, so it can trigger an extra lookup if HaveCoin uses Exists and the caller later needs the actual value.
We’re already delegating most HaveCoin calls to GetCoin anyway for the above reasons, so the CCoinsViewDB implementation of HaveCoin is redundant.
Fix
Remove CCoinsViewDB::HaveCoin (falls back to the base CCoinsView::HaveCoin which delegates to GetCoin) and simplify CCoinsViewCache::HaveCoin to use AccessCoin.
Testing
A unit test was added to confirm that HaveInputs calls the database’s ::GetCoin (not ::HaveCoin) on cache miss and checks cache first.
Also added a benchmark to track throughput before/after changes to ensure no regression.
Note: the latest version of the change keeps most HaveCoin calls for convenience, a previous version removed all of them.