Fixes a race where node1 processes the previous block submitted, between the two getblockcount calls on node1.
When that happens on the last block, then the test would fail on getblockhash with error “Block height out of range”.
Fixed by calling getblockcount once only.