Fix sprite:on_animation_changed() called twice.

The event was called twice when changing the animation or direction of a
sprite.