[refactor/test] Extract P2PTxInvStore into test framework
Summary:
This is a backport of Core PR18038 [5/7]
https://github.com/bitcoin/bitcoin/pull/18038/commits/6851502472d3625416f0e7796e9f2a0379d14d49
Depends on D9009
Test Plan: ninja check-functional
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D9010