Implement named pipes for windows, touch up unix

* Implementation of pipe_win32 filled out for libnative
* Reorganize pipes to be clone-able
* Fix a few file descriptor leaks on error
* Factor out some common code into shared functions
* Make use of the if_ok!() macro for less indentation

Closes #11201
Rename Bitwise::population_count to Bitwise::count_ones and add Bitwise::count_zeros

These are inspired by the [functions in the Julia standard library](http://docs.julialang.org/en/release-0.2/stdlib/base/#Base.count_ones).
Remove Freeze bounds from sync::MutexArc

With Rc no longer trying to statically prevent cycles (and thus no
longer using the Freeze bound), it seems appropriate to remove that
restriction from MutexArc as well.
Forbid use of generics with foreign functions. Closes #10353.
Update tasks guide: SharedChan as been removed

The code examples are up to date, but the surrounding explanations are not.
auto merge of #12284 : brson/rust/install, r=alexcrichton

Work toward #9876.

This adds `prepare.mk`, which is simply a more heavily-parameterized `install.mk`, then uses `prepare` to implement both `install` and the windows installer (`dist`). Smoke tested on both Linux and Windows.
std: iteratize str::is_utf16 & add tests.

Most of the tests are randomly generated with Python 3 and rely on it's
UTF-16be encoder/decoder being correct.
std: convert str::from_utf16 to an external iterator.

Fixes #12316.
str: provide lossy UTF-16 support.

This replaces the iterator with one that handles lone surrogates
gracefully and uses that to implement `from_utf16_lossy` which replaces
invalid `u16`s with U+FFFD.
std: decode even numbered non-BMP planes in the UTF-16 decoder.

Fixes #12318.
std: make str::from_utf16 return an Option.

The rest of the codebase is moving toward avoiding `fail!` so we do it
here too!
auto merge of #12325 : big-guy/rust/doc-fixes, r=alexcrichton

* Change '...your own time' => '...your own type'
* Fix typo in the Vector2D example
auto merge of #12331 : bjz/rust/count-ones, r=alexcrichton

This is inspired by the [function naming in the Julia standard library](http://docs.julialang.org/en/release-0.2/stdlib/base/#Base.count_ones). It seems like a more self-explanatory name, and is more consistent with the accompanying methods, `leading_zeros` and `trailing_zeros`.
Added more scripts to tidy check
auto merge of #12337 : nick29581/rust/generic_extern, r=alexcrichton

and fix up some formatting.
Remove the compile-fail test that's now obsolete
backticks for syntax elements
Spellcheck library docs.
Fix a deadlock in channels, again.

This deadlock was caused when the channel was closed at just the right time, so
the extra `self.cnt.fetch_add` actually should have preserved the DISCONNECTED
state of the channel. by modifying this the channel entered a state such that
the port would never succeed in dropping.

This also moves the increment of self.steals until after the MAX_STEALS block.
The reason for this is that in 'fn recv()' the steals variable is decremented
immediately after the try_recv(), which could in theory set steals to -1 if it
was previously set to 0 in try_recv().

Closes #12340
auto merge of #12352 : alexcrichton/rust/fix-master, r=brson

This deadlock was caused when the channel was closed at just the right time, so
the extra `self.cnt.fetch_add` actually should have preserved the DISCONNECTED
state of the channel. by modifying this the channel entered a state such that
the port would never succeed in dropping.

This also moves the increment of self.steals until after the MAX_STEALS block.
The reason for this is that in 'fn recv()' the steals variable is decremented
immediately after the try_recv(), which could in theory set steals to -1 if it
was previously set to 0 in try_recv().

Closes #12340