If a peer received an inv about a transaction, which was included in a block before receiving the corresponding getdata, it can be beneficial to send this transaction to the peer to aid compact block relay.
Add a test for this to avoid breaking it in the future.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/27695 | core#27695]]