Namecoin testnet beta

I would like to create a new branch on namecoin/libcoin. The branch would be namecoin-testnet-beta, the beta part is to indicate that it still uses some hacks to let it sync.
Here again, this looks like a fix for a really annoying problem.  Please propose this upstream as a separate patch, I'm sure @gronager will accept it.