### Description

In cases where the same agg is used, instead of computing it multiple times, make another reference to it:
```
stats a = min(x), b = min(x) by z
```

should become
```
stats a = min(x) by z
eval b = a
keep a,b,z
```

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/LogicalPlanOptimizer.java
@Override
        public LogicalPlan apply(LogicalPlan plan) {
            var collectRefs = new AttributeMap<Expression>();
            
            plan.forEachExpressionUp(Alias.class, a -> {
                var c = a.child();
                if (c.foldable()) {
                    collectRefs.put(a.toAttribute(), c);
                }
            });
            if (collectRefs.isEmpty()) {
                return plan;
            }
            java.util.function.Function<ReferenceAttribute, Expression> replaceReference = r -> collectRefs.resolve(r, r);
            plan = plan.transformUp(p -> {
                
                if (p instanceof Filter || p instanceof Eval) {
                    p = p.transformExpressionsOnly(ReferenceAttribute.class, replaceReference);
                }
                return p;
            });
            return plan;
        }
    }
    static class PushDownAndCombineLimits extends OptimizerRules.OptimizerRule<Limit> {