The locking was added in a [[https://github.com/bitcoin/bitcoin/pull/15615#discussion_r266254817 | previous pull request]] during the review phase, but the reason for this lock was later [[https://github.com/bitcoin/bitcoin/pull/15615#pullrequestreview-218084866 | removed during the same review]].
Backport of Core PR16793
Depends on D7634