[Issue286] Add support for atomic file renaming

See #286.
Whatever log level is used, I don't think it's related to the return value :smile: