[libvirt] [PATCH 10/20] qemumonitortestutils: Refactor the test helpers to allow reuse