index: Allow atomic commits of index state to be extended.
Summary: This is a partial backport of Core PR14121 : https://github.com/bitcoin/bitcoin/pull/14121/commits/4368384f1d267b011e03a805f934f5c47e2ca1b2
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D6332