Fixed #18729 -- Added more precise use_distinct check for list_filter

Added check to get_filters to only flag query for distinct based on
list_filter if that list_filter is actually being used.
Queries using distinct can be *very slow* so should be avoided if
not needed.
I don't think adding the same item to a M2M twice has any effect?