gif: Fix clear code handling when at end of a block
gif: Fix clear code handling when at end of a block

The following was occurring:
1. A clear code is detected in the LZW stream.
2. The decoder enters a clear code handling state.
3. The decoder looks for the next code after the clear.
4. The decoder has run out of blocks, so enters a state to get new blocks

The issue is in step 4 the decoder has assumed the clear state is complete,
when it is not. The solution is to only complete the clear state once a
non clear code is read.

This caused the "Circular table entry in GIF file" error for some GIFs.
Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/issues/27
Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/issues/69

GNOME/gdk-pixbuf,GNOME/gdk-pixbuf,GNOME/gdk-pixbuf,GNOME/gdk-pixbuf