Fix restart hang, close session at the end of the reactors