### CI Link

https://gradle-enterprise.elastic.co/s/tevty3fksm3jc

### Repro line

./gradlew ':server:test' --tests "org.elasticsearch.search.aggregations.metrics.InternalTDigestPercentilesTests.testConcurrentEquals" -Dtests.seed=542D87AA584FF03D -Dtests.locale=es-AR -Dtests.timezone=Asia/Baghdad -Druntime.java=20

### Does it reproduce?

Yes

### Applicable branches

main

### Failure history

_No response_

### Failure excerpt

The failure occurs intermittently. I was able to get it to fail 2-3 times when running with `-Dtests.iters=100`. Note that I found this on my own PR CI, but it reproduces in main.

```
java.util.ConcurrentModificationException
at java.base/java.util.ArrayList.sort(ArrayList.java:1723) |  
at java.base/java.util.Collections.sort(Collections.java:145) |  
at org.elasticsearch.tdigest.SortingDigest.compress(SortingDigest.java:71) |  
at org.elasticsearch.tdigest.SortingDigest.centroids(SortingDigest.java:95) |  
at org.elasticsearch.tdigest.SortingDigest.centroidCount(SortingDigest.java:136) |  
at org.elasticsearch.tdigest.HybridDigest.centroidCount(HybridDigest.java:167) |  
at org.elasticsearch.search.aggregations.metrics.TDigestState.centroidCount(TDigestState.java:251) |  
at org.elasticsearch.search.aggregations.metrics.TDigestState.equals(TDigestState.java:169) |  
at java.base/java.util.Objects.equals(Objects.java:64)
```
libs/tdigest/src/main/java/org/elasticsearch/tdigest/SortingDigest.java
};
            }
            @Override
            public int size() {
                return values.size();
            }
        };
    }
    @Override
    public double compression() {
        return 1;
    }
    @Override
    public int centroidCount() {
        return centroids().size();
    }
    @Override
    public void reserve(long size) {
        int newSize = (size + values.size() > Integer.MAX_VALUE) ? Integer.MAX_VALUE : values.size() + (int) size;
        values.ensureCapacity(newSize);
    }
    /**
     * Returns an upper bound on the number bytes that will be required to represent this histogram.
     */
    @Override
    public int byteSize() {
        return values.size() * 8;
    }
}