Fix XenAPI.py on python2.7

This fix was made by Mike Mcclurg here:

https://bugs.launchpad.net/xcp/+bug/917913

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