Simplify while loop in testAsyncReadFileByLine()