Upstream support for giflib >= 5.1. DO NOT MERGE am: 5fb3d513cc  -s ours am: ebb72bb1db am: adaabc27b5  -s ours am: b4b6595918 am: 5af154d012 am: f7f1fe6363 am: b995ed29e4  -s ours am: 7da439d41a am: f482be4a8c am: 00a8e2d36a
am: 3048777667

Change-Id: I632bcfdd07ef6320753ba5ed2ecf550863e1a71f