validation: replace lock with annotation in UnloadBlockIndex()
Summary:
This is a partial backport of core#24299
https://github.com/bitcoin/bitcoin/pull/24299/commits/daad0093e3d1466789d0ce687902636c80cd74a1
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D12988