SF: Avoid accessing an invalidated iterator

If we erase the element currently pointed to by
the iterator, the iterator will be invalidated.
Fix this by updating the iterator.

Bug: 238781169
Test: presubmit
Change-Id: I5306cb15f7665f53475ce2fa3b5ef6a897f73dca
1 file changed