Put simulation cleanup code in a try:finally block.

This means that when networks are killed e.g. due to a Node crashing (or in the GUI's case, a node raising an exception to end the simulation) the network is cleaned up nicely.

(p.s. @tcstewar though not as late as my award winning commit I do feel that committing stuff after the end of summer school party deserves some (sad) kudos...)
I think it would be desirable to have some other type of exception to allow a node to cleanly exit a simulation without losing out on getting simulation results.