`#count` in conjunction with `#uniq` performs distinct count.

This is a fix for #6865

It makes sure that we perform a `COUNT(DISTINCT *)` when `Relation.uniq.count` is used. While writing up the patch we noticed that the "count" code path is very different from the other calculations. I wanted to submit a small patch for the problem but we will try to clean up the count code in a second PR.