master: Call fsync after dumping metadata

Master used to spend much time flushing buffers before renaming backup
files, so now it is done in the process which dumps metadata.

Change-Id: I230245ef335ba3fca35bb156de14b3a3a012b68b