[2.3] Use `Filesystem::chmod` instead of `chmod` when dumping file

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

This adds consistency as discussed in https://github.com/symfony/symfony/commit/ca5eea5c1922688685d104f962bc5d16626ce05d#commitcomment-5804089