sync: Implement weak pointers for Arc<T>

This implementation is the same as Rc<T>, except that it's atomic in a few
places. The only major difference is the `upgrade` method which uses a CAS loop
instead of a fetch_add to increase the strong reference count.

This commit brings Arc and Rc to parity with the same apis and the same
functionality.