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 core#27695