mgi shared mem channel close/term fixes