Ensure parent directory when saving a resource file
When creating a new resource file with `pyxel edit D:/dir/test.pyxres`, if the parent directory (`dir` in this case) doesn't exist, the resource editor will crash if you try to save:
```
thread '<unnamed>' panicked at 'Unable to open file 'D:\dir\test.pyxres'', D:\a\pyxel\pyxel\crates\pyxel-engine\src\resource.rs:117:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
This can potentially make a user lose all their progress so far (like I just did 😞).