Fix running scripts not properly updated when done programmatically

Add a slot to Application to receive ScriptEngine::finished signals.
Notify the Running scripts widget of stopped scripts so it can properly
move them to the recent scripts list.
Fix style issue
Merge pull request #2850 from huffman/19654

19654 - Fix running scripts not properly updated when done programmatically