wm: fix close socket issue