Reset counter before doing pushState

When doing a page update using pushState, first reset the counter to 0.
It's possible that previous runs have caused the counter to be at a
number that it cannot recover from, so reseting it ensures that each
page is down afresh.