File renaming should be the last operation of an atomic write

That way there is just no possible race conditions.

cc @wisq
Yeah, but the problem is that I'm sure many, many people have been using this method without specifying a directory, and it has Just Worked™ because of `FileUtils.mv`, even though they were getting a very non-atomic `atomic_write`.

If we change this without adjusting the `temp_dir` default, we a) **will** break a lot of code, and b) will make it a pain to use, since who wants to do `File.atomic_write(some_path, File.dirname(some_path))` all the time instead of just `File.atomic_write(some_path)` ?