fix(util.go) make writeFileSynced return error properly