Set umask before writing key.