Fixes #8551 - host recieves correct smart_class_parameter value when multiple overrides in inherited Host Groups exist for parameter

`path2matches` returned the matchers in the correct order (the more specific hostgroup match came first) but the `where` returned the order of lookup_values by id
 if the less specific matcher was created first it would be first in `all_lookup_values` and the `sort_by` in line 42 would keep it first 
after that in `update_generic_matcher` it was picked as the highest priority matcher and the host would get the override value of the less specific hostgroup