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
Reset migrating task state for MigrationError exceptions

Create an exception type for pre-check errors and add it to the list
of exceptions for which instance task state is reset to ACTIVE to
avoid cases where an instance get stuck in MIGRATING state.

Convert existing instances of raise MigrationError in scheduler and
driver pre-checks to have them raise the new MigrationPreCheckError
exception instead.

In addition, also make sure that expected exceptions are passed over
RPC silently.

Resolves bug 1171526.

Change-Id: I00fa0962e555f895dd98861684ec7767fed3b37b
Merge "Sync jsonutils from oslo"
Merge "Sync small and safe changes from oslo"
Merge "Reset migrating task state for MigrationError exceptions"