GIF error reporting - improved thread safety, and work for older libgif
Accommodate some changes in recent cmake for HDF5 finding