Sync jsonutils from oslo

This is a sync of commit 9dcf688ea80f52cdb5413514198b2aa81d5a4e09 from
the oslo-incubator project. It should improve the serialisation
performance in general and tests runtime specifically.

Change-Id: I6b0e7baeb24951ce3c0bc129d20c65daa0d8fa61
Sync small and safe changes from oslo

Ran the oslo-incubator sync script and brought across only the files
that have small and safe changes.

Change-Id: I41b400c189e52a2e7f642a03ad143d821aaa807c
Merge "Sync jsonutils from oslo"
Merge "Sync small and safe changes from oslo"