fsync directories as well as files

When we create a new file, that file can be lost in a crash unless the
containing directory is synced.

Bug: 130637124
Bug: 137666560
Test: ensure pattern setting still works.
Change-Id: I5ec05a98cb5077950d1a4214aca6801c73450b62
1 file changed