Unref() object when connection is closed