outputconfigurationstore: handle imperfect matches for outputs better
There are some situations where there can be multiple matches for a given output, like when two outputs with the same EDID ID but different EDID hashes or connector names were connected before and now only one of them is connected. In these situations, we'd previously just pick the first match in the list, even though the other match is more precise; and that could end up changing the settings for that output. Once the second output is connected again, it would then get the wrong settings.
To fix that, the function searches for matches by first making a list with all the possible matches, and finds the most exact match instead of the first one in the list.
Commits 2 and 3 add some tests to cover this and some other tricky situations with output identification