[Issue286] Add support for atomic file renaming