'off' callback may be a bound or an unbound function

Previously we were assuming the `off` callback was the original function. This covers the case where it is a bound function.