remove event if function code matches

this fixes a problem i was having with socket.io for ex:
socket.on("blah", this.eventhandler)
socket.removeListener("blah", this.eventhandler)