python: make all objects hashable

This commit removes __cmp__() from all classes (BaseThread and
BaseFrame). This has the consequence that they inherit the default
__cmp__ and __hash__ making all objects hashable.

Instead of __cmp__(), method equals() i