Patch uuid.py to avoid a bug in the Python ctypes module

Shipping IPython is a priority so we can't wait for this to be resolved
by Python themselves. It's already been around for almost a year anyway.
Refs #8179