After #14935, the [TSAN Travis job](https://travis-ci.org/bitcoin/bitcoin/jobs/468142290) is consistently failing when running the `cuckoocache_erase_parallel_ok` test:

```
Leaving test case "test_cuckoocache_no_fakes"; testing time: 1096188mks
Entering test case "cuckoocache_erase_parallel_ok"
==================
WARNING: ThreadSanitizer: data race (pid=25684)
  Write of size 8 at 0x7d340000ce60 by thread T2:
    #0 memcpy <null> (test_bitcoin+0x000000490510)
    #1 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long) <null> (libstdc++.so.6+0x00000011ff2c)
    #2 std::this_thread::__sleep_for(std::chrono::duration<long, std::ratio<1l, 1l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) <null> (libstdc++.so.6+0x0000000b8c7f)
  Previous write of size 8 at 0x7d340000ce60 by thread T1:
    #0 memcpy <null> (test_bitcoin+0x000000490510)
    #1 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long) <null> (libstdc++.so.6+0x00000011ff2c)
    #2 std::this_thread::__sleep_for(std::chrono::duration<long, std::ratio<1l, 1l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) <null> (libstdc++.so.6+0x0000000b8c7f)
  Location is heap block of size 201 at 0x7d340000ce60 allocated by main thread:
    #0 operator new(unsigned long) <null> (test_bitcoin+0x000000510853)
    #1 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long) <null> (libstdc++.so.6+0x00000011f87c)
    #2 __libc_start_main <null> (libc.so.6+0x00000002082f)
  Thread T2 (tid=25687, running) created by main thread at:
    #0 pthread_create <null> (test_bitcoin+0x000000490b06)
    #1 std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>, void (*)()) <null> (libstdc++.so.6+0x0000000b8dc2)
    #2 void std::vector<std::thread, std::allocator<std::thread> >::_M_emplace_back_aux<void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}>(void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/vector.tcc:416 (test_bitcoin+0x0000006139d1)
    #3 void std::vector<std::thread, std::allocator<std::thread> >::emplace_back<void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}>(void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/vector.tcc:101 (test_bitcoin+0x0000006139d1)
    #4 void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long) /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:218 (test_bitcoin+0x0000006139d1)
    #5 cuckoocache_tests::cuckoocache_erase_parallel_ok::test_method() /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:264 (test_bitcoin+0x0000006139d1)
    #6 cuckoocache_tests::cuckoocache_erase_parallel_ok_invoker() /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:261 (test_bitcoin+0x00000061329f)
    #7 boost::unit_test::ut_detail::unused boost::unit_test::ut_detail::invoker<boost::unit_test::ut_detail::unused>::invoke<void (*)()>(void (*&)()) /usr/include/boost/test/utils/callback.hpp:56 (test_bitcoin+0x000000564e39)
    #8 boost::unit_test::ut_detail::callback0_impl_t<boost::unit_test::ut_detail::unused, void (*)()>::invoke() /usr/include/boost/test/utils/callback.hpp:89 (test_bitcoin+0x000000564e39)
    #9 boost::unit_test::test_case_filter::test_case_filter(boost::unit_test::basic_cstring<char const>) <null> (libboost_unit_test_framework.so.1.58.0+0x00000006acb0)
    #10 __libc_start_main <null> (libc.so.6+0x00000002082f)
  Thread T1 (tid=25686, running) created by main thread at:
    #0 pthread_create <null> (test_bitcoin+0x000000490b06)
    #1 std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>, void (*)()) <null> (libstdc++.so.6+0x0000000b8dc2)
    #2 void std::vector<std::thread, std::allocator<std::thread> >::_M_emplace_back_aux<void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}>(void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/vector.tcc:416 (test_bitcoin+0x0000006139d1)
    #3 void std::vector<std::thread, std::allocator<std::thread> >::emplace_back<void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}>(void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/vector.tcc:101 (test_bitcoin+0x0000006139d1)
    #4 void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long) /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:218 (test_bitcoin+0x0000006139d1)
    #5 cuckoocache_tests::cuckoocache_erase_parallel_ok::test_method() /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:264 (test_bitcoin+0x0000006139d1)
    #6 cuckoocache_tests::cuckoocache_erase_parallel_ok_invoker() /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:261 (test_bitcoin+0x00000061329f)
    #7 boost::unit_test::ut_detail::unused boost::unit_test::ut_detail::invoker<boost::unit_test::ut_detail::unused>::invoke<void (*)()>(void (*&)()) /usr/include/boost/test/utils/callback.hpp:56 (test_bitcoin+0x000000564e39)
    #8 boost::unit_test::ut_detail::callback0_impl_t<boost::unit_test::ut_detail::unused, void (*)()>::invoke() /usr/include/boost/test/utils/callback.hpp:89 (test_bitcoin+0x000000564e39)
    #9 boost::unit_test::test_case_filter::test_case_filter(boost::unit_test::basic_cstring<char const>) <null> (libboost_unit_test_framework.so.1.58.0+0x00000006acb0)
    #10 __libc_start_main <null> (libc.so.6+0x00000002082f)
SUMMARY: ThreadSanitizer: data race (/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/test_bitcoin+0x490510) in memcpy
==================
==================
WARNING: ThreadSanitizer: data race (pid=25684)
  Write of size 8 at 0x7d340000ce68 by thread T2:
    #0 memcpy <null> (test_bitcoin+0x000000490510)
    #1 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long) <null> (libstdc++.so.6+0x00000011ff2c)
    #2 std::this_thread::__sleep_for(std::chrono::duration<long, std::ratio<1l, 1l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) <null> (libstdc++.so.6+0x0000000b8c7f)
  Previous write of size 8 at 0x7d340000ce68 by thread T1:
    [failed to restore the stack]
  Location is heap block of size 201 at 0x7d340000ce60 allocated by main thread:
    #0 operator new(unsigned long) <null> (test_bitcoin+0x000000510853)
    #1 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long) <null> (libstdc++.so.6+0x00000011f87c)
    #2 __libc_start_main <null> (libc.so.6+0x00000002082f)
  Thread T2 (tid=25687, running) created by main thread at:
    #0 pthread_create <null> (test_bitcoin+0x000000490b06)
    #1 std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>, void (*)()) <null> (libstdc++.so.6+0x0000000b8dc2)
    #2 void std::vector<std::thread, std::allocator<std::thread> >::_M_emplace_back_aux<void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}>(void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/vector.tcc:416 (test_bitcoin+0x0000006139d1)
    #3 void std::vector<std::thread, std::allocator<std::thread> >::emplace_back<void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}>(void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/vector.tcc:101 (test_bitcoin+0x0000006139d1)
    #4 void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long) /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:218 (test_bitcoin+0x0000006139d1)
    #5 cuckoocache_tests::cuckoocache_erase_parallel_ok::test_method() /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:264 (test_bitcoin+0x0000006139d1)
    #6 cuckoocache_tests::cuckoocache_erase_parallel_ok_invoker() /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:261 (test_bitcoin+0x00000061329f)
    #7 boost::unit_test::ut_detail::unused boost::unit_test::ut_detail::invoker<boost::unit_test::ut_detail::unused>::invoke<void (*)()>(void (*&)()) /usr/include/boost/test/utils/callback.hpp:56 (test_bitcoin+0x000000564e39)
    #8 boost::unit_test::ut_detail::callback0_impl_t<boost::unit_test::ut_detail::unused, void (*)()>::invoke() /usr/include/boost/test/utils/callback.hpp:89 (test_bitcoin+0x000000564e39)
    #9 boost::unit_test::test_case_filter::test_case_filter(boost::unit_test::basic_cstring<char const>) <null> (libboost_unit_test_framework.so.1.58.0+0x00000006acb0)
    #10 __libc_start_main <null> (libc.so.6+0x00000002082f)
  Thread T1 (tid=25686, finished) created by main thread at:
    #0 pthread_create <null> (test_bitcoin+0x000000490b06)
    #1 std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>, void (*)()) <null> (libstdc++.so.6+0x0000000b8dc2)
    #2 void std::vector<std::thread, std::allocator<std::thread> >::_M_emplace_back_aux<void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}>(void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/vector.tcc:416 (test_bitcoin+0x0000006139d1)
    #3 void std::vector<std::thread, std::allocator<std::thread> >::emplace_back<void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}>(void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long)::{lambda()#1}&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/vector.tcc:101 (test_bitcoin+0x0000006139d1)
    #4 void cuckoocache_tests::test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher> >(unsigned long) /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:218 (test_bitcoin+0x0000006139d1)
    #5 cuckoocache_tests::cuckoocache_erase_parallel_ok::test_method() /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:264 (test_bitcoin+0x0000006139d1)
    #6 cuckoocache_tests::cuckoocache_erase_parallel_ok_invoker() /home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/cuckoocache_tests.cpp:261 (test_bitcoin+0x00000061329f)
    #7 boost::unit_test::ut_detail::unused boost::unit_test::ut_detail::invoker<boost::unit_test::ut_detail::unused>::invoke<void (*)()>(void (*&)()) /usr/include/boost/test/utils/callback.hpp:56 (test_bitcoin+0x000000564e39)
    #8 boost::unit_test::ut_detail::callback0_impl_t<boost::unit_test::ut_detail::unused, void (*)()>::invoke() /usr/include/boost/test/utils/callback.hpp:89 (test_bitcoin+0x000000564e39)
    #9 boost::unit_test::test_case_filter::test_case_filter(boost::unit_test::basic_cstring<char const>) <null> (libboost_unit_test_framework.so.1.58.0+0x00000006acb0)
    #10 __libc_start_main <null> (libc.so.6+0x00000002082f)
SUMMARY: ThreadSanitizer: data race (/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/src/test/test_bitcoin+0x490510) in memcpy
```
{
    auto queue = MakeUnique<FrozenCleanup_Queue>(QUEUE_BATCH_SIZE);
    boost::thread_group tg;
    bool fails = false;
    for (auto x = 0; x < nScriptCheckThreads; ++x) {
        tg.create_thread([&]{queue->Thread();});
    }
    std::thread t0([&]() {
        CCheckQueueControl<FrozenCleanupCheck> control(queue.get());
        std::vector<FrozenCleanupCheck> vChecks(1);