qemu: usb passthrough: move device matching logic

from view to lib