virttest.utils_test: Add two functions for cdrom attach and eject

Several libvirt cases need attach/eject CDROM, so extract these two common functions here.

Signed-off-by: Yanbing Du <ydu@redhat.com>
So your above function actually is a helper for this one, and this function is used for a special test case that eject cdrom with executing virsh attach twice. It seems these two functions will not be used in easily in other cases. Do you mind make them in your test script as a local functions rather than in utils_test.libvirt as a global helper functions.