fix(sync) leader should do a sync before committing log entires
As we do not fsync every time log writes to file when the state is leader, we need to do fsync before actually committing the log entries to ensure safety.