[upstream] Fix libwebp and imlib2 for building with giflib-5.1.0