[avalanche] Add a facility to check if a peer is preferred for DL
Summary:
This wraps up the access to the state's fPreferredDownload flag to
prevent code duplication.
There is no change in behavior.
Depends on D9582.
Part of T1611.
Test Plan:
ninja all check-all ./test/functional/test_runner.py p2p_inv_download
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Maniphest Tasks: T1611
Differential Revision: https://reviews.bitcoinabc.org/D9625