Properly shutdown and free DtpNode/Session, added hooks for manually shutting down session/node.