Fix cache conflict in `_check_legacy_cache2`
It was reloading from the wrong cache dir because of a bug in `_check_legacy_cache2`. This function should not trigger if there are config_kwars like `sample_by=`

fix https://github.com/huggingface/datasets/issues/6758