[Issue286] Add support for atomic file renaming
Merge pull request #288 from n-lagomarsini/Issue286_1_6

[Issue286] Add support for atomic file renaming (Backport on 1.6.x)