Factorize the tx use count checks in blockencodings_tests
Summary: This is a simple code deduplication, that will make the follow-up diffs easier to review.
Test Plan:
ninja check-bitcoin-blockencodings_tests
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D13436