This reverts commit rABC22c85ce64493710b114ad598a594f9a9b25422c5.
This is a backport of core [[https://github.com/bitcoin/bitcoin/pull/18521 | PR18521]]. It is similar to D8376 rebased
on top of D8525 which fixes the tsan race.
Depends on D8634 for the test plan.