Improve rename-file behavior on macOS