Fixed transitionend bug in HTMLElement#animate()

When setting a new animation at the end of the current one, the new animation would end immediately if there were still transitionend events being processed from the first transition's ending.