lib/util: only change umask during mkdir()