QHash: use prime numbers when rebucketing

QHash uses an array representing the difference between 2^i and
the next prime; when growing, it calculates 2^x + array[x] (with
`x' representing the "hash table size in bits").

For some reason lost in history the differences are actually wrong
and the calculation above leads to using composite numbers.

Hence: use the right sequence and always produce primes. The right
sequence is actually A092131 from OEIS: http://oeis.org/A092131

Note that the sequence starts at A(1), but we need A(0) too.
Also we truncate the sequence to when growing too much, just like
the old code did, and use powers of two in that case instead.

Task-number: QTBUG-36866
Change-Id: Id2e3fc9cb567c0fdca305dee38f480e17639ca04
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>