Fix newline handling on MS Windows