atomic_write rescue also Errno::EACCES

atomic_write rescue also Errno::EACCES on changing file permission. It could be raised with some type of filesystem
Merge pull request #17230 from robertoz-01/master

atomic_write rescue also Errno::EACCES