objectquery: factor out sysimage prep

This moves system image preparation out of the `ObjectQueryMiddleware`
and into a util function in the `common` module.
test_common: test for get_zerovm_sysimage_devices
common: add `iter_pairs` util function
common: simplify get_zerovm_sysimage_devices