Make UUID format checking more correct.
Make UUID format checking more correct.

This patch uses the same logic from glance to verify if a UUID is
properly formed.  It just tries to build a uuid.UUID from the string.
A test case has been added which previously would have failed, but now
passes.

A second test case has been added that verifies that the result of the
gen_uuid() function is considered valid, as well.

Change-Id: I33fe37b23ef03eda0f0e9d69afb601ca260aabde

citrix-openstack-build/oslo.versionedobjects,openstack/oslo.versionedobjects