[CMAKE] Run the leveldb tests serially
This adds a facility to create a job pool with an arbitrary number of
concurrent jobs and assign it to a test suite. This is used to limit the
leveldb suite to a single job and make the tests run serially.
This adds about 20% to the leveldb tests duration on my machine, but
since they are only running as part of the check-all (or higher) global
target the impact is minor.
This is expected to prevent spurious leveldb failures like
Depends on D7073.
ninja all check-all ninja check-leveldb
Check it still works with make, even if the pool has no effect:
cmake .. make -j42 check-leveldb
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D6751