Add support for giterr_last.

This should simplify hunting the insane permissions error.
s/die/fail/