Auto merge of #26610 - aturon:fix_make_unique, r=alexcrichton
Auto merge of #26610 - aturon:fix_make_unique, r=alexcrichton

This commit resolves the race condition in the `get_mut` and
`make_unique` functions, which arose through interaction with weak
pointers. The basic strategy is to "lock" the weak pointer count when
trying to establish uniqueness, by reusing the field as a simple
spinlock. The overhead for normal use of `Arc` is expected to be minimal
-- it will be *none* when only strong pointers are used, and only
requires a move from atomic increment to CAS for usage of weak pointers.

The commit also removes the `unsafe` and deprecated status of these functions.

Closes #24880

r? @alexcrichton 

cc @metajack @SimonSapin @Ms2ger 

nwin/rust,dwillmer/rust,l0kod/rust,l0kod/rust,aidancully/rust,reem/rust,mvdnes/rust,jashank/rust,vhbit/rust,graydon/rust,jashank/rust,nwin/rust,mvdnes/rust,vhbit/rust,pshc/rust,zubron/rust,GBGamer/rust,graydon/rust,graydon/rust,zubron/rust,GBGamer/rust,aidancully/rust,mvdnes/rust,dwillmer/rust,jashank/rust,nwin/rust,dwillmer/rust,pshc/rust,pshc/rust,GBGamer/rust,GBGamer/rust,nwin/rust,reem/rust,nwin/rust,aidancully/rust,GBGamer/rust,zubron/rust,jroesch/rust,l0kod/rust,vhbit/rust,jroesch/rust,nwin/rust,pshc/rust,graydon/rust,vhbit/rust,zubron/rust,pshc/rust,dwillmer/rust,nwin/rust,jroesch/rust,jroesch/rust,l0kod/rust,jashank/rust,aidancully/rust,jashank/rust,mvdnes/rust,jroesch/rust,zubron/rust,aidancully/rust,graydon/rust,vhbit/rust,dwillmer/rust,dwillmer/rust,mvdnes/rust,mvdnes/rust,reem/rust,reem/rust,reem/rust,pshc/rust,jroesch/rust,pshc/rust,pshc/rust,zubron/rust,GBGamer/rust,jashank/rust,GBGamer/rust,dwillmer/rust,jroesch/rust,jashank/rust,reem/rust,l0kod/rust,dwillmer/rust,zubron/rust,vhbit/rust,aidancully/rust,nwin/rust,vhbit/rust,GBGamer/rust,graydon/rust,jashank/rust,zubron/rust,l0kod/rust,jroesch/rust,vhbit/rust,l0kod/rust,l0kod/rust