### 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
compress();
        return Dist.cdf(x, values);
    }
    @Override
    public double quantile(double q) {
        compress();
        return Dist.quantile(q, values);
    }
    @Override
    public Collection<Centroid> centroids() {
        compress();
        return new AbstractCollection<>() {
            @Override
            public Iterator<Centroid> iterator() {
                return new Iterator<>() {
                    int i = 0;
                    @Override
                    public boolean hasNext() {
                        return i < values.size();
                    }
                    @Override
                    public Centroid next() {
                        Centroid rc = new Centroid(values.get(i), 1);
                        i++;
                        return rc;
                    }
                    @Override
                    public void remove() {
                        throw new UnsupportedOperationException("Default operation");
                    }