fixed sync progress calculation

chain download is sometimes restarted when a previous connection is
closed, and previously the counter would reset back to 0 if that
happened