[Issue286] Add support for atomic file renaming

See #286.
Logging this every time it fails will lead to a lot of log bloat. Could you keep track of whether this warning has been emitted before and only warn the first time?