Helper method for canceling a gesture recognizer.