Make attachEvent ignore multiple identical handlers