Fixes #8333 - correct matcher values with multi-key matchers

After daf34ae7195fda204ff6c9afdec8f14e4ce4f795 was merged the hostgroup matchers are sorted by length because of inheritance matching. 
This causes a problem with multi-key matchers as: `os=example, hostgroup=hostgroup_example`.
For now `hostgroup` is the only case where inheritance is checked when matching lookup values (https://github.com/theforeman/foreman/blob/develop/app/services/classification/base.rb#L105-108), if that changes this code will need refactoring.