Fix a KeysEqual bug

See https://bugs.launchpad.net/testtools/+bug/1177217 for details.