file-gif-load: Fail early if GetCode() fails (Bug #737375)

(cherry picked from commit 55150487ff9ed53ecb90ae4fca3d615e24057fae)