This NPE issue is different from #99477 and #99516

### CI Link

https://gradle-enterprise.elastic.co/s/v7icocftg32uc/tests/task/:server:internalClusterTest/details/org.elasticsearch.snapshots.SnapshotStressTestsIT/testRandomActivities%20%7Bseed=%5B32DA52B8E1546052:7737AEA21D8C5249%5D%7D?top-execution=1

### Repro line

./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.snapshots.SnapshotStressTestsIT.testRandomActivities {seed=[32DA52B8E1546052:7737AEA21D8C5249]}" -Dtests.seed=32DA52B8E1546052 -Dtests.locale=cs -Dtests.timezone=America/El_Salvador -Druntime.java=21

### Does it reproduce?

No

### Applicable branches

main

### Failure history

https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.snapshots.SnapshotStressTestsIT&tests.test=testRandomActivities%20%7Bseed%3D%5B32DA52B8E1546052:7737AEA21D8C5249%5D%7D

### Failure excerpt

```
WARNING: Uncaught exception in thread: Thread[#108,elasticsearch[node_s0][masterService#updateTask][T#1],5,TGRP-SnapshotStressTestsIT]
java.lang.AssertionError: java.lang.AssertionError: java.lang.NullPointerException: Cannot invoke "org.elasticsearch.cluster.SnapshotsInProgress$Entry.failure()" because "entry" is null
	at __randomizedtesting.SeedInfo.seed([32DA52B8E1546052]:0)
	at org.elasticsearch.snapshots.SnapshotsService.finalizeSnapshotEntry(SnapshotsService.java:1447)
	at org.elasticsearch.snapshots.SnapshotsService.runNextQueuedOperation(SnapshotsService.java:1535)
	at org.elasticsearch.snapshots.SnapshotsService.lambda$finalizeSnapshotEntry$28(SnapshotsService.java:1428)
	at org.elasticsearch.action.ActionListener$2.onResponse(ActionListener.java:177)
	at org.elasticsearch.repositories.FinalizeSnapshotContext.onResponse(FinalizeSnapshotContext.java:116)
	at org.elasticsearch.repositories.FinalizeSnapshotContext.onResponse(FinalizeSnapshotContext.java:28)
	at org.elasticsearch.action.ActionListenerImplementations$DelegatingResponseActionListener.onResponse(ActionListenerImplementations.java:182)
	at org.elasticsearch.action.support.SubscribableListener$SuccessResult.complete(SubscribableListener.java:310)
	at org.elasticsearch.action.support.SubscribableListener.tryComplete(SubscribableListener.java:230)
	at org.elasticsearch.action.support.SubscribableListener.setResult(SubscribableListener.java:259)
	at org.elasticsearch.action.support.SubscribableListener.onResponse(SubscribableListener.java:173)
	at org.elasticsearch.repositories.blobstore.BlobStoreRepository.lambda$finalizeSnapshot$19(BlobStoreRepository.java:1684)
	at org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:236)
	at org.elasticsearch.action.support.SubscribableListener$SuccessResult.complete(SubscribableListener.java:310)
	at org.elasticsearch.action.support.SubscribableListener.tryComplete(SubscribableListener.java:230)
	at org.elasticsearch.action.support.SubscribableListener.setResult(SubscribableListener.java:259)
	at org.elasticsearch.action.support.SubscribableListener.onResponse(SubscribableListener.java:173)
	at org.elasticsearch.action.ActionListenerImplementations$MappedActionListener.onResponse(ActionListenerImplementations.java:95)
	at org.elasticsearch.repositories.blobstore.BlobStoreRepository$9.clusterStateProcessed(BlobStoreRepository.java:2690)
	at org.elasticsearch.cluster.service.MasterService$UnbatchedExecutor.lambda$execute$0(MasterService.java:552)
	at org.elasticsearch.cluster.service.MasterService$ExecutionResult.onPublishSuccess(MasterService.java:927)
	at org.elasticsearch.cluster.service.MasterService$4.onResponse(MasterService.java:374)
	at org.elasticsearch.cluster.service.MasterService$4.onResponse(MasterService.java:369)
	at org.elasticsearch.action.ActionListenerImplementations$RunAfterActionListener.onResponse(ActionListenerImplementations.java:260)
	at org.elasticsearch.action.ActionListener$4.onResponse(ActionListener.java:330)
	at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:32)
	at org.elasticsearch.action.support.ThreadedActionListener$1.doRun(ThreadedActionListener.java:50)
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.AssertionError: java.lang.NullPointerException: Cannot invoke "org.elasticsearch.cluster.SnapshotsInProgress$Entry.failure()" because "entry" is null
	... 32 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.elasticsearch.cluster.SnapshotsInProgress$Entry.failure()" because "entry" is null
	at org.elasticsearch.snapshots.SnapshotsService.finalizeSnapshotEntry(SnapshotsService.java:1311)
	... 31 more

```
server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java
import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.common.util.concurrent.ListenableFuture;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.SuppressForbidden;
import org.elasticsearch.core.Tuple;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.IndexVersion;
import org.elasticsearch.index.IndexVersions;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.indices.SystemDataStreamDescriptor;
import org.elasticsearch.indices.SystemIndices;
import org.elasticsearch.repositories.FinalizeSnapshotContext;
import org.elasticsearch.repositories.IndexId;
import org.elasticsearch.repositories.RepositoriesService;
import org.elasticsearch.repositories.Repository;
import org.elasticsearch.repositories.RepositoryData;
import org.elasticsearch.repositories.RepositoryException;
import org.elasticsearch.repositories.RepositoryMissingException;
import org.elasticsearch.repositories.RepositoryShardId;
import org.elasticsearch.repositories.ShardGeneration;
import org.elasticsearch.repositories.ShardGenerations;
import org.elasticsearch.repositories.ShardSnapshotResult;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Deque;