Fix `Animation.hasEnded()` so it is true after `invokeEnd()`/`cancel()`

This just adds a flag to `ShadowAnimation` so `invokeEnd()` and `cancel()` correctly update the result of `hasEnded`. 

Fixes #381.