Create temporary files in the temp dir
We probably also should check whether the workaround for QSafeFile is still needed.