runtime: Fix invalid freeing of old graph/networks

Happened when moving between to graph and back in Flowhub
References #8