Print newline at the end of the items.

Sort filters could produce incorrect output. When an item at the bottom of todo.txt (without trailing newline) gets sorted, the next item in order could end up on the same line.

Just let echo print that final newline. I didn't notice that the task count got confused because of this.