Do all block index writes in a batch
Merge pull request #5367

63d1ae5 Do all block index writes in a batch (Pieter Wuille)