speed up delete_lines_matching as proposed in #133