Only use count() optimization if there are no joins

The count() helper optimization only works if the current query.statement performs no JOINs.
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 the joined-loaded relation.
Merge pull request #309 from goodscloud/fix-count-helper

Only use count() optimization if there are no joins