libguestfs.tests: Move shared classes and functions to utils_test.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>