Redmine#4076: improve acceptance test for countlinesmatching()
Use CfReadLine instead of getline for countlinesmatching

To prevent having to match newline. Close #4076