Fix timing issue in rehash test (#10388)
Fix timing issue in rehash test (#10388)

`Expected '*table size: 4096*' to match '*table size: 8192*'`

This test failed once on daily macOS, the reason is because
the bgsave has not stopped after the kill and `after 200`.
So there is a child process and no rehash triggered.

This commit use `waitForBgsave` to wait for it to finish.
PKRoma/redis,soloestoy/redis,charsyam/redis,oranagra/redis,antirez/redis,soloestoy/redis,soloestoy/redis,yossigo/redis,oranagra/redis,PKRoma/redis,antirez/redis,neomantra/redis,neomantra/redis,ofirluzon/redis,yossigo/redis,yossigo/redis,oranagra/redis,PKRoma/redis,antirez/redis,charsyam/redis,soloestoy/redis,yossigo/redis,ofirluzon/redis,charsyam/redis,oranagra/redis,yossigo/redis,soloestoy/redis,PKRoma/redis,neomantra/redis,oranagra/redis,neomantra/redis,PKRoma/redis,ofirluzon/redis,charsyam/redis,charsyam/redis,neomantra/redis,ofirluzon/redis,ofirluzon/redis,antirez/redis