close socket asynchronously