fix(state/file): set 'changes' when creating file

The 'changes' field was never set due to file existence check was done
after the actual creation of the file.
Merge pull request #11269 from JensRantil/file-state-creation-change

fix(state/file): set 'changes' when creating file