Fixed a crash at the end of CrostiniInstall

The crash happened when a CrostiniRestarter callback caused the modification of
maps that were currently being iterated, invalidating assumptions of
what can be safely erased. The safe fix is to erase from the maps first,
saving the restarter objects into a temporary vector and then calling the
callbacks from iterating the vector.

Bug: 845227
Change-Id: I64296262d1881122ec89b0083c2f29b4ea354aa9
Reviewed-on: https://chromium-review.googlesource.com/1068301
Reviewed-by: Timothy Loh <timloh@chromium.org>
Commit-Queue: Nicholas Verne <nverne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560486}
2 files changed