Fix animationend event with CSS3 transitions.