Atomic write permissions should default to 0644.

Temporary files in ruby default to very conservative permissions. Since
atomic writes start their life as a temporary file, this caused the
resulting file to have the permissions of a temporarily file instead
of the permissions you'd expect by File.open.

This patch makes sure that atomic writes are the same as normal file
permissions which is basically 0666 and then masked by the umask.