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

I'm a little worried about using a .order on line 39 on key=value (match), followed by a .sort_by on keys, in case the sort doesn't retain the sorting of the values.  (It appears to, but I don't think it's defined that it must.)

Should we remove the order() and extend the sort_by block to sort by both the path and the value (when the path keys are identical)?