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.
Merge pull request #1 from r0stig/patch-1

Set isEnded flag before callback