fixes #33128.
this picks up #33164.
Chainstate::LoadGenesisBlock() could rewrite the genesis block even
when blk00000.dat already contained valid block data. this becomes a
problem when the block index is missing or corrupted while the block
files are still intact, such as during an explicit -reindex or an
incomplete shutdown.
a call to LoadGenesisBlock() eventually reaches AllocateFileRange(),
which falls back to writing zeroes to extend the file on platforms
without a real posix_fallocate() syscall. when the index is missing,
this can overwrite existing block data beyond genesis. in #33128,
deleting blocks/index and running -reindex could therefore destroy
the remaining blocks and leave the node with only genesis, without
reporting any error.
the primary fix is in LoadGenesisBlock(): check for an existing valid
genesis block at {0, 0} before writing it, and reuse it when
present.
AllocateFileRange() also gets a small defensive change: its fallback
no longer writes over a range that is already within the file. it only
extends the file when necessary, protecting other callers that may
encounter the same situation.