Fix bug #9179 (New Untitled documents have wrong line endings on Windows) --
Use correct form of Document.getText() in Save As, like in Save.
Plus unit test.