Avoid duplicating blocks and txs on privkey imports.

When detaching the tail end of a slice of blocks or transactions and
appending the newly inserted middle block, and the previous tail, the
capacity of the slice head must be limited to prevent overwriting the
newly inserted block/tx in the same memory as the tail slice.

Bug discovered by @mably while working on the peercoin port of
btcwallet and reported on IRC.