**Describe what's wrong**

Clickhouse keeper is crashing during initialization with segfault. This repeats on every start - we're unable to start the keeper server, either from existing data or from the new ones, it always crashes after a few minutes of initializing. We're running a standalone dockerized keeper instance.

**Does it reproduce on recent release?**

Yes, we're using the version v22.7 of keeper.

**How to reproduce**

* Which ClickHouse server version to use: 

We tested these versions (so far) and all are crashing with the same error
```
v22.7.1.2484
v22.7.4.16
v22.8.2.11
---
v22.5.1.2079 
```

* Non-default settings, if any:

We tweaked some configurations which may be related, though it's inconclusive on our side:

```
    <coordination_settings>
      <force_sync>false</force_sync>
      <max_requests_batch_size>2000</max_requests_batch_size>
    </coordination_settings>
```

**Expected behavior**

We don't expect the process to crash.

**Error message and/or stacktrace**

```
successfully receive a snapshot (idx 4149762924 term 335) from leader
Compact logs up to log index 4149762924, our max log id is 4148717923
Seems like this node recovers from leaders snapshot, removing all logs
Removing changelog /var/lib/clickhouse/coordination/log/changelog_4148562925_4148662924.bin.zstd because of compaction
Trying to remove log /var/lib/clickhouse/coordination/log/changelog_4148662925_4148762924.bin.zstd which is current active log for write. Possibly this node recovers from snapshot
Removing changelog /var/lib/clickhouse/coordination/log/changelog_4148662925_4148762924.bin.zstd because of compaction
Removed changelog /var/lib/clickhouse/coordination/log/changelog_4148562925_4148662924.bin.zstd because of compaction.
Removed changelog /var/lib/clickhouse/coordination/log/changelog_4148662925_4148762924.bin.zstd because of compaction.
Compaction up to 4149762924 finished new min index 4149762925, new max index 4149762924
successfully compact the log store, will now ask the statemachine to apply the snapshot
########################################
(version 22.7.1.2484 (official build), build id: BB14295F0BE31ECF) (from thread 66) (no query) Received signal Segmentation fault (11)
Address: NULL pointer. Access: read. Address not mapped to object.
Stack trace: 0xa5860d
0. ? @ 0xa5860d in /usr/bin/clickhouse-keeper
Integrity check of the executable skipped because the reference checksum could not be read. (calculated checksum: E4590F1FEA25C5B140060D818924BBD1)
```

i + 1,
                    sleep_ms * (i + 1));
            std::this_thread::sleep_for(std::chrono::milliseconds(sleep_ms * (i + 1)));
        }
        if (!added)
            throw Exception(
                ErrorCodes::RAFT_ERROR,
                "Configuration change to add server (id {}) was not accepted by RAFT after all {} retries",
                task.server->get_id(),
                coordination_settings->configuration_change_tries_count);
    }
    else if (task.action_type == ConfigUpdateActionType::RemoveServer)
    {
        LOG_INFO(log, "Will try to remove server with id {}", task.server->get_id());
        bool removed = false;
        if (task.server->get_id() == state_manager->server_id())
        {
            LOG_INFO(
                log,
                "Trying to remove leader node (ourself), so will yield leadership and some other node (new leader) will try remove us. "
                "Probably you will have to run SYSTEM RELOAD CONFIG on the new leader node");
            raft_instance->yield_leadership();
            return;
        }
        for (size_t i = 0; i < coordination_settings->configuration_change_tries_count && !is_recovering; ++i)
        {
            if (raft_instance->get_srv_config(task.server->get_id()) == nullptr)
            {
                LOG_INFO(log, "Server with id {} was successfully removed", task.server->get_id());
                removed = true;