Fix "check-names master" and "check-names slave"
requested to merge 2911-9-16-21-regression-legacy-check-names-configuration-does-not-work-anymore-v9_16 into v9_16
check for type "master" / "slave" at the same time as checking for "primary" / "secondary" as we step through the maps.
Checking "primary" then "master" or "master" then "primary" does not work as the synomym is not checked for to stop the search. Similarly with "secondary" and "slave".
(cherry picked from commit a3c6516a)
Closes #2911 (closed)