Removes the global event handler.