Bug 958758. If we need to re-decode an image with different flags and shutting down the existing decoder has caused us to finish decoding we need to discard the image so we can create a new decoder with the new flags. r=seth
Bug 958758. Refactor common image discard checks into one place. r=seth