Mutex cs_main is already held by the caller of WriteUndoDataForBlock().
This change is needed to require CBlockIndex::GetUndoPos() to hold
cs_main and CBlockIndex::nStatus to be guarded by cs_main in the
following commits without adding 2 unnecessary cs_main locks to
WriteUndoDataForBlock().
This is a partial backport of core#22932
https://github.com/bitcoin/bitcoin/pull/22932/commits/2e557ced2830fc54476e598d52225f1679205e7d
Depends on D13031