gh-7053: check for OSError during rehashx()