objectquery: factor out sysimage prep

This moves system image preparation out of the `ObjectQueryMiddleware`
and into a util function in called `get_zerovm_sysimage_devices`.