Incorrect reference count management in NameServer_detach