Fix the automatic computation of `max_steps` when resuming an experiment
jenkins Does this fix work with all 4 classes of Samplers inside the train dataloader? (MegatronPretrainingSampler, MegatronPretrainingRandomSampler, MegatronPretrainingBatchSampler, MegatronPretrainingRandomBatchSampler) This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days. This PR was closed because it has been inactive for 7 days since being marked as stale.
# What does this PR do ?

This fixes a bug in #7518 where `max_steps` wasn't computed properly when resuming an experiment in the middle of an epoch (my fault -- I hadn't realized the training dataloader had a smaller length on resume).

I have tested it locally to confirm both the bug and the fix.

I don't really like that we need to mess with the sampler but that's the best I could think of. Happy to take other suggestions as well.

NB: I also added an extra safety check for `limit_train_batches` but this is unrelated to the bug being fixed.

**Collection**: core

# Changelog 
- Fix learning rate schedule in Megatron models when max_steps is not set and an experiment is resumed


# Before your PR is "Ready for review"
**Pre checks**:
- [X] Make sure you read and followed [Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md)
- [ ] Did you write any new necessary tests?
- [ ] Did you add or update any necessary documentation?
- [ ] Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
  - [ ] Reviewer: Does the PR have correct import guards for all optional libraries?
  
**PR Type**:
- [ ] New Feature
- [X] Bugfix
- [ ] Documentation

## Who can review?

Anyone in the community is free to review the PR once the checks have passed. 
[Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md) contains specific people who can review PRs to various areas.

# Additional Information
* Related to #7518
