Fully rewrite txindex on upgrading blkindex.dat format.

When upgrading the blkindex.dat data format, actually fully rewrite the
txindex objects stored in it.
Fix merge from Namecoin.

Replace the version number used in the patch from Namecoin to the
correct one for Huntercoin.