fs/sync: enable dyn fsync by default, code clean up and optimisations

Change-Id: I9a65bcd0a84dfa29a2a1a6419494a1464e7d2f0c