This uses the somewhat restrictive umask of 0027 so that people outside the user or group cannot read the files. This also helps to inhibit TOCTOU where someone else has a handle to our file before we chmod it and after we close it.