Allow specifying umask for cmd
Merge pull request #4143 from wichert/cmd-umask

Allow specifying umask for cmd.