Fix device selection where preference can be lost

Swapping a device to a new USB port whereby it is given a new UID results in
that device going to the bottom of the device preference list.

The fix is to check the device preference list for the device name to determine
whether it should be selected

(cherry picked from commit ba6e498f3a3baaf5fff5dd0a330d4b9848dcd6bc)