Don't use .eof() as stopping criteria for while loop

This caused infinite loops after the new implementation of stone_string
introduced in commit 06c12bf