Rewrite of hash_relocate() using zend_hash_rehash, and flushing tmp files
to avoid problems when PHP executes forks.