Takes extra precautions of flushing disk cache with autosave.

We must flush every time we save the content file, not only
the last time.
Adds regression test for autosave.