Bug: Do not rely on obj.__cmp__() in data manager.

Objects where compared within the transaction manager for different
reasons. This could create complicated scenarios (including data loss) when
the ``__cmp__()`` method of the object was non-trivial. Now the result of
the ``id(obj)`` function is used to compare objects, which is very save,
since the behavior of this function call cannot be changed for an object.