runtime: fix lchan deletion in method reset

When we perform a reset while multiple channels are open (this is in
particular the case when parsing real world traces with pySim-trace). To
delete those channels during the reset we iterate over the dictionary
using the keys and delete the channels one by one. However, this must
not be done using the keys as index directly. Python will then throw an
exception: "RuntimeError: dictionary changed size during iteration".

Instead using the keys directly we should cast them into a list and then
using that list for the iteration.

Related: OS#6094
Change-Id: I430ef216cf847ffbde2809f492ee9ed9030343b6
diff --git a/pySim/runtime.py b/pySim/runtime.py
index 5d181e8..642e9c1 100644
--- a/pySim/runtime.py
+++ b/pySim/runtime.py
@@ -124,7 +124,7 @@
             cmd_app : Command Application State (for unregistering old file commands)
         """
         # delete all lchan != 0 (basic lchan)
-        for lchan_nr in self.lchan.keys():
+        for lchan_nr in list(self.lchan.keys()):
             if lchan_nr == 0:
                 continue
             del self.lchan[lchan_nr]