Let socket close gracefully