Preserve permissions when using Pathname#atomic_write