Implement atomic save

Ping @fperez, this should avoid issues with corrupted/lost notebooks when the disk is full, though I haven't worked out how to test it just yet.

Closes gh-6254
I've seen this problem when using Microsoft's own .Net API to overwrite files with other files too.  But, there is a way to do it using the Windows API: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363851(v=vs.85).aspx

I doubt it's worth the trouble to wrap if it's not already done so in something like http://sourceforge.net/projects/pywin32/ .

Thoughts?