Fixed crash in case of some malformed jpegs
With certain malformed jpegs the call to jpeg_finish_decompress caused a long jump back to stop_loading. This jump overwrote the value of the surface pointer which should be NULL which in turn caused a cairo assert when trying to get a reference to a surface with ref_count = 0.
Also moved the cleanup of in_buffer out of the !finished scope, as it seems this would otherwise be a potential leak.
Fixes #106 (closed)
Edited by Joerg