optimise pruning of aggs

optimise pruning of aggregators for topN
Merge pull request #884 from metamx/optimize-topN-pruning

optimise pruning of aggs