tests/qtest: Move mkimg() and have_qemu_img() from libqos to libqtest