Don't dump the `hash` vector if it will need to be recomputed anyway

* src/fns.c (hash_table_rehash): Only set `hash` field at the end.
(sweep_weak_table): Only set slot of `hash` vector when that vector exists.
(Fhash_table_count): No need to hash_rehash_if_needed any more.

* src/lisp.h (hash_rehash_needed_p): Test the presence of `hash` instead.

* src/pdumper.c (check_hash_table_rehash, dump_hash_table):
Set `hash` to nil to indicate that the table needs to be rehashed.
1 job for master in 23 minutes and 19 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Test
failed #2727
test-all

00:23:19

 
Name Stage Failure
failed
test-all Test
Makefile:319: recipe for target 'compile-main' failed
make[2]: *** [compile-main] Error 2
make[2]: Leaving directory '/builds/emacs/emacs/lisp'
Makefile:411: recipe for target 'lisp' failed
make[1]: *** [lisp] Error 2
make[1]: Leaving directory '/builds/emacs/emacs'
make: *** [bootstrap] Error 2
Makefile:1117: recipe for target 'bootstrap' failed
ERROR: Job failed: exit code 1