virttest.utils_test.libvirt: add new test utilities

Remote access libvirtd will use these 2 new functions, and other test cases also probably reuse them, so move these 2 functions from test cases to virttest/utils_test/libvirt.py.

Hi, this is a deprecated function. And it will be removed in later version of virt-test. Keeping it here is just make the old tp-libvirt work well. You can get more information in https://github.com/autotest/virt-test/pull/1584