performance optimization in inventory.groups_list()

don't calculate all hosts for every parent group of every group
when that parent group was already in the cache
Merge pull request #3041 from sergevanginderachter/performance-groups-list

performance optimization in inventory.groups_list()