Reproduces more or less deterministically on https://demo.elastic.co

```
POST _query
{
  "query":"from metrics-* | stats avg(event.duration) | limit 10"
}
```

```
Caused by: java.lang.NullPointerException: Cannot invoke "org.elasticsearch.index.mapper.MappedFieldType.typeName()" because "fieldType" is null
	at org.elasticsearch.xpack.esql.stats.SearchStats.detectSingleValue(SearchStats.java:185)
	at org.elasticsearch.xpack.esql.stats.SearchStats.lambda$isSingleValue$10(SearchStats.java:168)
	at org.elasticsearch.xpack.esql.stats.SearchStats.doWithContexts(SearchStats.java:283)
	at org.elasticsearch.xpack.esql.stats.SearchStats.isSingleValue(SearchStats.java:167)
	at org.elasticsearch.xpack.esql.optimizer.LocalPhysicalPlanOptimizer$PushStatsToSource.lambda$pushableStats$0(LocalPhysicalPlanOptimizer.java:379)
	at java.util.Map.computeIfAbsent(Map.java:1066)
	at org.elasticsearch.xpack.esql.optimizer.LocalPhysicalPlanOptimizer$PushStatsToSource.pushableStats(LocalPhysicalPlanOptimizer.java:364)
	at org.elasticsearch.xpack.esql.optimizer.LocalPhysicalPlanOptimizer$PushStatsToSource.rule(LocalPhysicalPlanOptimizer.java:331)
	at org.elasticsearch.xpack.esql.optimizer.LocalPhysicalPlanOptimizer$PushStatsToSource.rule(LocalPhysicalPlanOptimizer.java:323)
	at org.elasticsearch.xpack.esql.optimizer.PhysicalOptimizerRules$ParameterizedOptimizerRule.lambda$apply$0(PhysicalOptimizerRules.java:37)

```


x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/stats/SearchStats.java
doWithContexts(r -> {
                        sv[0] &= detectSingleValue(r, mappedType, field);
                        return sv[0];
                    }, true);
                    break;
                }
                stat.singleValue = sv[0];
            }
        }
        return stat.singleValue;
    }
    private boolean detectSingleValue(IndexReader r, MappedFieldType fieldType, String name) throws IOException {
        
        if (fieldType instanceof ConstantFieldType || fieldType instanceof DocCountFieldType || fieldType instanceof TimestampFieldType) {
            return true;
        }
        var typeName = fieldType.typeName();
        
        boolean found = switch (typeName) {
            case IdFieldMapper.NAME, SeqNoFieldMapper.NAME -> true;
            default -> false;
        };
        if (found) {
            return true;
        }
        
        DocCountTester tester = null;
        if (fieldType instanceof DateFieldType || fieldType instanceof NumberFieldType) {
            tester = lr -> {
                PointValues values = lr.getPointValues(name);