Fix potential resource leak from the LineReader