**Build scan:**
https://gradle-enterprise.elastic.co/s/34efhhw3goeag/tests/:server:internalClusterTest/org.elasticsearch.search.scroll.SearchScrollIT/testRestartDataNodesDuringScrollSearch

**Reproduction line:**
```
./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.search.scroll.SearchScrollIT.testRestartDataNodesDuringScrollSearch" -Dtests.seed=E6A0214B9EEB529 -Dtests.locale=nl -Dtests.timezone=Asia/Gaza -Druntime.java=20
```

**Applicable branches:**
main, 8.8

**Reproduces locally?:**
No

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.search.scroll.SearchScrollIT&tests.test=testRestartDataNodesDuringScrollSearch

**Failure excerpt:**
```
com.carrotsearch.randomizedtesting.UncaughtExceptionError: Captured an uncaught exception in thread: Thread[id=4779, name=elasticsearch[node_s4][search][T#1], state=RUNNABLE, group=TGRP-SearchScrollIT]

  at __randomizedtesting.SeedInfo.seed([E6A0214B9EEB529:F926017924B84B2B]:0)

  Caused by: java.lang.AssertionError: invalid decRef call: already closed

    at __randomizedtesting.SeedInfo.seed([E6A0214B9EEB529]:0)
    at org.elasticsearch.core.AbstractRefCounted.decRef(AbstractRefCounted.java:51)
    at org.elasticsearch.search.fetch.QueryFetchSearchResult.decRef(QueryFetchSearchResult.java:103)
    at org.elasticsearch.transport.OutboundHandler.lambda$sendResponse$1(OutboundHandler.java:143)
    at org.elasticsearch.core.IOUtils.close(IOUtils.java:71)
    at org.elasticsearch.core.IOUtils.close(IOUtils.java:87)
    at org.elasticsearch.core.IOUtils.close(IOUtils.java:63)
    at org.elasticsearch.core.Releasables.close(Releasables.java:73)
    at org.elasticsearch.core.Releasables.close(Releasables.java:41)
    at org.elasticsearch.core.Releasables$2.close(Releasables.java:111)
    at org.elasticsearch.action.ActionListener$1.lambda$onFailure$0(ActionListener.java:120)
    at org.elasticsearch.action.ActionListenerImplementations.safeAcceptException(ActionListenerImplementations.java:59)
    at org.elasticsearch.action.ActionListener$1.onFailure(ActionListener.java:120)
    at org.elasticsearch.transport.OutboundHandler$1.onFailure(OutboundHandler.java:229)
    at org.elasticsearch.transport.netty4.Netty4TcpChannel.sendMessage(Netty4TcpChannel.java:168)
    at org.elasticsearch.transport.OutboundHandler.internalSend(OutboundHandler.java:211)
    at org.elasticsearch.transport.OutboundHandler.sendMessage(OutboundHandler.java:196)
    at org.elasticsearch.transport.OutboundHandler.sendResponse(OutboundHandler.java:139)
    at org.elasticsearch.transport.TcpTransportChannel.sendResponse(TcpTransportChannel.java:61)
    at org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:42)
    at org.elasticsearch.action.support.ChannelActionListener.lambda$onResponse$0(ChannelActionListener.java:31)
    at org.elasticsearch.action.ActionListener.run(ActionListener.java:357)
    at org.elasticsearch.action.support.ChannelActionListener.onResponse(ChannelActionListener.java:31)
    at org.elasticsearch.action.support.ChannelActionListener.onResponse(ChannelActionListener.java:19)
    at org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:50)
    at org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:47)
    at org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72)
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
    at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)
    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.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.lang.Thread.run(Thread.java:1623)

```
modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4TcpChannel.java
if (f.isSuccess()) {
                listener.onResponse(null);
            } else {
                Throwable cause = f.cause();
                if (cause instanceof Error) {
                    ExceptionsHelper.maybeDieOnAnotherThread(cause);
                    listener.onFailure(new Exception(cause));
                } else {
                    listener.onFailure((Exception) cause);
                }
            }
        });
    }
    /**
     * Creates a {@link ChannelPromise} for the given {@link Channel} and adds a listener that invokes the given {@link ActionListener}
     * on its completion.
     * @param listener lister to invoke
     * @param channel channel
     * @return write promise
     */
    public static ChannelPromise addPromise(ActionListener<Void> listener, Channel channel) {
        ChannelPromise writePromise = channel.newPromise();
        writePromise.addListener(f -> {
            if (f.isSuccess()) {
                listener.onResponse(null);
            } else {
                final Throwable cause = f.cause();
                ExceptionsHelper.maybeDieOnAnotherThread(cause);
                if (cause instanceof Error) {
                    listener.onFailure(new Exception(cause));