Fix occassional exceptions on tcl/tk 8.6 when executing python scripts from the GUI.
Fix occassional exceptions on tcl/tk 8.6 when executing python scripts from the GUI.

From: santiago
coreemu/core,hakiri/core,hakiri/core,hakiri/core,coreemu/core,coreemu/core,coreemu/core