[Python-checkins] bpo-41373: IDLE: Fix saving files loaded with no newlines or mixed newlines (GH-21597)