blockchain: Rework AdvanceToHeight.
blockchain: Rework AdvanceToHeight.

This reworks the AdvanceToHeight method introduced in the previous
commit to resolve various issues with it and simplify the code.

decred/dcrd,decred/dcrd