chmod only if newmode != oldmode
