compat/setenv.c: update errno when erroring out