Set isEnded flag before callback

If you want to create an infinite animation by calling startCanvasAnimation in the callback onAnimationEnd the isEnded flag will be set back to true even throught the animation class reset method set it to false. Which makes the animation stop.