Fix: When releasing socket, stop TX thread first.