master: more narrow scope for unmask

Previously umask could be left as 191 (0277) in some cases.
master: fixed direct user query via getpwnam

Previously founduser was set but unused.