files/file: fix consistency between chmod and stat calls