Close the client connection when attached finishes