std: use ptr.offset where possible in the vec iterator.

Closes #8212.