- Sync the temporary credential file after writing JSON data and before closing and renaming it onto the target path, closing and removing the temp file if sync fails.
- Remove the unused strconv import and dead strconv.IntSize placeholder in SaveTokenToFile.
- Add regression tests verifying sync ordering before close/rename and temp file cleanup with existing credential preservation on sync error.
Closes: #7718