use umask to restrict file permissions

I'm not sure how to fix this for WIN32, but I hope Francis can assist.