Fixing performance issues in some forum queries.

DataQuery always adds DISTINCT to queries, but this slows down when
doing things like count on Post, as there can be a lot of records in
that table. This removes the unneeded distincts, and in some count
queries falls back to a simpler query.