Fix double free when connection close.