git_mkstemps: correctly test return value of open()