Only use count() optimization if there are no joins

The `count()` helper optimization only works if the current `query.statement` performs no `JOIN`s.
However, if a relation is set to use joined-load, the current `query.statement` will perform a
join, and the `count()` helper will return a number that is the number of objects found for
the current endpoint *multiplied* by the number of objects in each joined-loaded relation.