Add local thread pool to CCheckQueue and use it in tests
Summary:
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/18710 | core#18710]] [2/4]
https://github.com/bitcoin/bitcoin/pull/18710/commits/01511776acb0c7ec216dc9c8112531067763f1cb
https://github.com/bitcoin/bitcoin/pull/18710/commits/dba30695fc42f45828db008e7e5b81cb2b5d8551
Depends on D10985
Test Plan:
With TSAN:
ninja && ninja check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10986