Fix out-of-boundary access in `caffe2::StartsWith` (#36672)
Summary:
`std::mismatch( InputIt1 first1, InputIt1 last1, InputIt2 first2 )` assumes that container for `first2` iterator contains at least `last1 - first` elements, which is not the case if `prefix` is longer than `str`
Found while running unit tests on Windows
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36672
Differential Revision: D21049407
Pulled By: malfet
fbshipit-source-id: ad45779d47a0c6898900e0247c920829a2179f62