Update stat data on flush and not for each write

This should greatly reduce the number of IndexedDB transactions we create.
Nit: I would make this message something like "write and then flush updates mtime" to distinguish it from the previous test.