'Non-locking version of remove(); does real work.'

def _remove(self, spec):

    key = self._get_matching_spec_key(spec)
    rec = self._data[key]
    if (rec.ref_count > 0):
        rec.installed = False
        return rec.spec
    del self._data[key]
    for dep in rec.spec.dependencies(_tracked_deps):
        self._decrement_ref_count(dep)
    return rec.spec
