reworks to clear shared_ptr<> of both command and data terminals and having DTE own it. When we swith to CMUX mode the ownership is transfered to CMux terminal