dyn_fsync: add sync on reboot/shutdown and fix resume

Change-Id: I055c3accc585ff1620a1224efeb7247dd597b64e