Port to giflib 5.0.5

I'm not sure when this API change was introduced in giflib, but with this patch compilation works using giflib 5.0.5 (and fails without it).
We might want to do further error handling depending on the value of error if NULL was returned.