Not all filesystems on linux supports the RENAME_NOREPLACE flag.
If we get a EINVAL return value, retry with a non atomic operation.
RENAME_NOREPLACE was introduced in 050d48edfc, so this is a regression
fix as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/118571