See https://github.com/bitcoin/bitcoin/pull/22762#issuecomment-951063826

This can be fixed by creating a new exception type and catching it in the right place.

#### Useful skills:

* C++ exceptions
* Addrman serialization
* Functional tests

#### Want to work on this issue?

For guidance on contributing, please read [CONTRIBUTING.md](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md) before opening your pull request.

if (!RenameOver(pathTmp, path)) {
        remove(pathTmp);
        return error("%s: Rename-into-place failed", __func__);
    }
    return true;
}
template <typename Stream, typename Data>
void DeserializeDB(Stream& stream, Data& data, bool fCheckSum = true)
{
    CHashVerifier<Stream> verifier(&stream);
    
    unsigned char pchMsgTmp[4];
    verifier >> pchMsgTmp;
    
    if (memcmp(pchMsgTmp, Params().MessageStart(), sizeof(pchMsgTmp))) {
        throw std::runtime_error{"Invalid network magic number"};
    }
    
    verifier >> data;
    
    if (fCheckSum) {
        uint256 hashTmp;
        stream >> hashTmp;
        if (hashTmp != verifier.GetHash()) {
            throw std::runtime_error{"Checksum mismatch, data corrupted"};
        }
    }
}
template <typename Data>
void DeserializeFileDB(const fs::path& path, Data& data, int version)