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.