Implement nameindex pruning.

The new RPC command "prune_nameindex DEPTH" can be used (similarly to
prune_gamedb) to remove old entries from the nameindex.  This should not
affect ongoing operation, unless a chain reorg happens beyond the kept
depth.

Removed are entries that are both "too old" and not the current one of a
name, as well as names which were killed already before the given
height.