Fix integer overflow in auxpow code.
Fix integer overflow in auxpow code.

CAuxPow::getExpectedIndex was using math on uint32_t that could
(deliberately) overflow.  This works in practice, but is undefined
behaviour in C++ and triggered sanity checks (see
https://github.com/namecoin/namecoin-core/issues/391).

This rewrites the calculation to be done in 64 bits and with explicit
modulo operations, to avoid an "implicit" overflow.  The behaviour is
not changed under the assumption that it implicitly wrapped around
before as it did on most systems.

domob1812/namecore,namecoin/namecoin-core,pataquets/namecoin-core,namecoin/namecore,domob1812/namecore,namecoin/namecoin-core,namecoin/namecore,pataquets/namecoin-core,pataquets/namecoin-core,namecoin/namecoin-core,namecoin/namecoin-core,pataquets/namecoin-core,pataquets/namecoin-core,domob1812/namecore,domob1812/namecore,namecoin/namecore,namecoin/namecore,namecoin/namecore,pataquets/namecoin-core,namecoin/namecoin-core,domob1812/namecore,namecoin/namecore,namecoin/namecoin-core,domob1812/namecore