A couple of resource cleanup fixes
While looking into expanding things round !805 (merged) I noticed a bunch of resource cleanup fixes. Most won't hit us when running as shell since the process terminates but it's better to be correct here - also for the case where we'd recreate individual objects/managers.
Signed-off-by: Guido Günther guido.gunther@puri.sm
Edited by Guido Gunther