uuid: add better error checking

Unit tests pass again.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>