[avalanche] Refactor the clearing of timed out requests in its own function
Summary: This makes the purpose of various pieces of code clearer. Because of the locks, it needs to scoped anyways.
Test Plan:
make check
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Subscribers: teamcity, schancel
Differential Revision: https://reviews.bitcoinabc.org/D2473