Primecoin: Fix mining code crashes when doing a -reindex.

GeneratePrimeTable() was not called when starting with the -reindex option.
Check that pindexBest is not NULL in BitcoinMiner().