Fix a bug on gfortran < 4.8, last line read twice

This happens when read text file with no advancing, the last line is
read twice before it raise error.