Fix usage of gmx_eof

gmx_eof has different behavior from gmx_eof and feof
should be used here.

Change-Id: I877c15d0edde64fe06ae2eedbda980f117509449