ndigits0z(n::BigInt, b): avoid expensive off-by-one check for b=2^k.

Fixes #8727, but it's kind of a bandaid since for non-power-of-two
bases ndigits0z is still slow due to GMP's inexcusable laziness. At
least for power-of-two bases, however, BigInt hashing is now about
3x faster and allocates no memory.
Merge branch 'master' of github.com:JuliaLang/julia