[avalanche_tests] fix block index accesses
Summary: In preparation for D5238: these should be locked, and we don't need [] operator insertion so let's use the usual lookup function.
Test Plan:
CC=clang CXX=clang++ cmake -GNinja .. -DCMAKE_BUILD_TYPE=Debug ninja check
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D5237