mk: Simplify how prepare.mk, install.mk, and dist.mk deal with stages

The only stage that can be installed from is 2 everywhere but windows,
3 on windows.

Closes #12799
auto merge of #13024 : brson/rust/issue-12799, r=thestinger

The only stage that can be installed from is 2 everywhere but windows,
3 on windows.

Lightly tested. Not actually tested on Windows, but I did confirm that a *similar* change fixed the problem on Windows.

Closes #12799
auto merge of #13043 : alexcrichton/rust/fix-rustdoc-windows, r=brson

If the dwShareMode parameter is 0 on windows, it "prevents other processes from
opening a file or device if they request delete, read, or write access", which
is the opposite of what we want! This changes the 0 parameter to something which
will allow multiple processes to open the file and then lock it.
sync: Bring the library up to date

* Remove clone-ability from all primitives. All shared state will now come
  from the usage of the primitives being shared, not the primitives being
  inherently shareable. This allows for fewer allocations for stack-allocated
  primitives.
* Add Mutex<T> and RWLock<T> which are stack-allocated primitives for purely
  wraping a piece of data
* Remove RWArc<T> in favor of Arc<RWLock<T>>
* Remove MutexArc<T> in favor of Arc<Mutex<T>>
* Shuffle around where things are located
  * The `arc` module now only contains `Arc`
  * A new `lock` module contains `Mutex`, `RWLock`, and `Barrier`
  * A new `raw` module contains the primitive implementations of `Semaphore`,
    `Mutex`, and `RWLock`
* The Deref/DerefMut trait was implemented where appropriate
* `CowArc` was removed, the functionality is now part of `Arc` and is tagged
  with `#[experimental]`.
* The crate now has #[deny(missing_doc)]

This is not a large-scale rewrite of the functionality contained within the
`sync` crate, but rather a shuffling of who does what an a thinner hierarchy of
ownership to allow for better composability.
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.
Review comments

This will get squashed to previous commits when the whole PR is ready to go