Port from namecoin-qt

RemoveFromMemoryPool - fixed handling of pending names when reorganizing the block chain
2ecd6df436861d23692550e739c6f5b5bf3f83c3