Modify GIFLIB New API patch to be conditional. Ref: bug#17790 on emacs-bugs