### 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
if (basicAliases.size() > 0) {
                        
                        field = (Alias) field.transformUp(e -> basicAliases.resolve(e, e));
                    }
                    keptFields.add(field);
                }
            }
            
            if (basicAliases.size() > 0) {
                
                List<NamedExpression> projections = new ArrayList<>(eval.output());
                
                for (int i = projections.size() - 1; i >= 0; i--) {
                    NamedExpression project = projections.get(i);
                    projections.set(i, basicAliasSources.getOrDefault(project, project));
                }
                LogicalPlan child = eval.child();
                if (keptFields.size() > 0) {
                    
                    child = new Eval(eval.source(), eval.child(), keptFields);
                }
                
                plan = new Project(eval.source(), child, projections);
            }
            return plan;
        }
    }
}