Snapshot cleanup
std: Move NativeMutex from &mut self to &self

The proper usage of shared types is now sharing through `&self` rather than
`&mut self` because the mutable version will provide stronger guarantees (no
aliasing on *any* thread).
sync: Move the concurrent queue to using &self

This commit also lifts it up a level in the module hierarchy in the soon-to-come
reorganization of libsync.
sync: Move the Mutex type to using &self

This also uses the Unsafe type for any interior mutability in the type to avoid
transmutes.
sync: Move Once to using &self

Similarly to the rest of the previous commits, this moves the once primitive to
using &self instead of &mut self for proper sharing among many threads now.
sync: Rewrite the base primitives

This commit rewrites the core primitives of the sync library: Mutex, RWLock, and
Semaphore. These primitives now have updated, more modernized apis:

* Guards are returned instead of locking with closures. All condition variables
  have moved inside the guards and extraneous methods have been removed.
* Downgrading on an rwlock is now done through the guard instead of the rwlock
  itself.

These types are meant to be general locks, not locks of an internal type (for
external usage). New types will be introduced for locking shared data.
sync: Introduce new wrapper types for locking

This introduces new synchronization types which are meant to be the foundational
building blocks for sharing data among tasks. The new Mutex and RWLock types
have a type parameter which is the internal data that is accessed. Access to the
data is all performed through the guards returned, and the guards all have
autoderef implemented for easy access.
sync: Update the arc module

This removes the now-outdated MutexArc and RWArc types. These are superseded by
Arc<Mutex<T>> and Arc<RWLock<T>>. The only remaining arc is the one true Arc.
Additionally, the arc now has weak pointers implemented for it to assist in
breaking cycles.

This commit brings the arc api up to parity with the sibling Rc api, making them
nearly interchangeable for inter and intra task communication.
sync: Wire up all of the previous commits

This updates the exports and layout of the crate
test: Update all tests with the sync changes
std: Unignore atomic tests
auto merge of #12900 : alexcrichton/rust/rewrite-sync, r=brson

* 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
  wrapping 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)]
* `Arc` now supports weak pointers

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.