Reduce count(not null) to count()

When `AVG(x)` and similar aggregates are transformed to `SUM(x)/COUNT(x)`, the `COUNT(x)` tend to duplicate.

I suggest check for non-distinct `COUNT` with at least one not-null argument and use plain `COUNT()`.