FIX: Avoid invalid memory access (possible crash) due to modification of a map that is being iterated over

While I was debugging an unrelated crash in Ubuntu 13.10 (which is probably not subtitlecomposer's fault, but a bug in Qt), I came across this invalid memory access (invalidating a map iterator by deleting the corresponding map entry and then executing the ++ operator on the invalid iterator), which also has the potential for a crash - although it didn't lead to a segfault in my case.