Fix issue about Windows line break in TextInputFormat

Window uses \r\n to split lines. so, for text files from Windows, when \n is used as delimiter, \r is still appear at the end of lines.

The code checks to see if \n is used as delimiter and end of a line is \r, then \r is removed from the line

The change is the same as in https://github.com/stratosphere/stratosphere/pull/577, but this time I move it into the TextInputFormat. https://github.com/stratosphere/stratosphere/pull/577 failed the test case for terasort because the input file uses DelimitedInputFormat but it is not a text file.