Determine line ending, save using line ending