GIF error reporting - improved thread safety, and work for older libgif