Added missing step of deleting cursor in case of an error reading blocks from disk.
Pointer for GetStats() is now scoped rather than manually deleted.
Merge pull request #598 from rnicoll/1.8-dev-reindex

Close cursor in case of error reading blocks