Fix length of IterableDatasetShard and add test
# What does this PR do?

This PR fixes the length computation of an `IterableDatasetShard` added in #13780 and ensures it is correct with a test.
It also adds a missing mapping in the test fetcher util, to make sure modifications in `trainer_pt_utils.py` are properly tested.