Bug 876332 - Set currentAnimationFrameTime correctly based on the current frame's timeout (not the next frame's timeout). r=jrmuizel

In AdvanceFrame(), timeout refers to the timeout of the *next* frame. Setting
the *current* animation frame time based on the *next* frame is nonsense, but
worked for images with uniform frame timings. Unfortunately some images
don't have uniform frame timings!
Bug 876355 - We must report telemetry *before* shutting down the decoder!  r=jrmuizel

This simply restores the control flow from pre-bug 716140.