Use *p_ in skip_whitespace and reset this_count

The way cur was used before didn't always update it value if it was
changed. Also reset this_count when multiple lines are skipped in one
call to skip_whitespace.