add libguestfs utlity methods to reduce code duplication in plugins
rework approach to target image customization with Oz to fix concurrency bugs

Our earlier approach to this attempted to use the base image libvirt_xml directly.
This duplicates a number of identifiers that must be unique, including the VM name,
uuid, TCP port for serial passthrough and the MAC address.

It is much easier and safer to ask Oz to recreate a new libvirt_xml to define the
customization VM.  We need to be mindful of changes in this Oz code going forward.

This also adds a lock protected wrapping sequence number to select the port used
for TCP/serial passthrough from the guest.  Oz selects this value at random which
means it is possible, though unlikely, that parallel Oz invocations within Factory
could have chosen the same value, resulting in a failure.

This remains a risk with the randomly selected MAC address.  However, the space
for this is much larger (2^24).

TODO: We should see if libvirt can be made to select either or both of these
values itself.

Finally, this adds code to the second-stage Oz customization to remove hard coded
MAC address data from ifcfg-eth0 and from udev.  Without this, RHEL6 and RHEL5
base images will inherit their base image MAC and fail to bring up a network when
booted as a cloned VM.  This same issue prevents cached JEOS images from working
in Oz for these OSes.
modify plugins to use shared utility functions for common libguestfs activities

At the moment this is mostly related to removing MAC address details from the images
and tagging images with a cloud-info file.

Note that the new shared utility functions are more flexible about the disk layout
of the incoming image.  This should help when we add support for arbitrary base
image imports.

Also note that the MAC removal and cloud-info tagging were actually completely
absent from the OpenStack plugin.  I have added them.  This was a bug.
Merge pull request #243 from aeolusproject/bug/concurrent_target_image3

Bug/concurrent target image3