Wrap calls to setgenerate...

...and drop unnecessary rpc call to getblockcount, since every simulation
starts over.
Same here. StopMining?