Fix checkqueue_tests use-after-scope
Summary:
This reverts the change to checkqueue_tests from D3146 to reapply the
fix from PR12477 (see D3566).
Test Plan:
With ASAN enabled:
src/test/test_bitcoin -t checkqueue_tests
Reviewers: #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D3598