Use class object for hash instead of the class method

The problem with doing `id(callback)` when callback is a class method, is that class methods get regenerated often, so two calls to id(self.callback) may give different results.

Instead we use `id(self.callback.__self__)` which is the class instance of the callback whose id does not change. This is documented here: https://docs.python.org/2/reference/datamodel.html.