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

The mining code crashes when trying to access vPrimes because GeneratePrimeTable is not called when doing a -reindex. Another crash happens if pindexBest happens to be NULL when the mining threads are starting.