fix issue with umask

with umask set to 0 all files created will use g+rw,o+rw which is
a security issue since for example the pidfile will be world writable