[system] Only run chflags if it is needed