### 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
* Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.elasticsearch.tdigest;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/**
 * Simple implementation of the TDigest interface that stores internally and sorts all samples to calculate quantiles and CDFs.
 * It provides perfect quantile and cdf calculations and matches or exceeds the performance of MergingDigest at least for millions of
 * samples, at the expense of allocating much more memory.
 */
public class SortingDigest extends AbstractTDigest {
    
    final ArrayList<Double> values = new ArrayList<>();
    
    private boolean isSorted = true;
    @Override
    public void add(double x, int w) {
        checkValue(x);
        for (int i = 0; i < w; i++) {
            values.add(x);
        }