jpegdec: free temporary buffer when changing state to NULL

Free temporary allocations in the state change function and not
only when the object is finalised.
1 file changed