Fix line ending parsing issues in spcomp on windows

fgetpos fails with UNIX \n new lines on windows if the file was open in
textual mode.