Fixing issue around removing listeners

When removing listeners, the comparison of the callbacks can fail. This was best seen when trying to remove cue points.