Improve reliability of avalanche test
Summary: It tends to be flacky because the loop tend to take too long to run when the system is uner load. This bails the loop when it took too long instead of failing the test.
Test Plan: Run the test multiple times in parallel.
Reviewers: #bitcoin_abc, jasonbcox, Fabien
Reviewed By: #bitcoin_abc, jasonbcox, Fabien
Subscribers: jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D4055