CORE-4720 Fixed app_count function results.

Added the DISTINCT clause to the App hid count, since the same App may appear in more than group.