files/file: add test for changing link permissions
files/file: fix consistency between chmod and stat calls