try to shutdown more safely so callbacks, etc don't try and use the read/write channels after they are closed