Preserve permissions when using Pathname#atomic_write
Write install receipts atomically