(bug 51363) Work around broken diffs.

Without I8ddc15d9, MapDiffer will return atomic diffs for
associative substructures that changed only the order of
entries, resulting in failure of code that expected these
diffs to always be instances of Diff.

This patch works around the broken diffs.

Note that this patch is still needed even after I8ddc15d9 is applied,
since we may still load broken diffs from the database or elsewhere.

Change-Id: I3835156f35e168ca3acd71a299ef8a218cb3a633
Merge "(bug 51363) Work around broken diffs."