Close cursor in case of error reading blocks

Added missing step of deleting cursor in case of an error reading blocks from disk. This fixes the assertion crash when loading a 1.7 block index in 1.8, and ensures the re-index can happen instead.