std: Implement SingleThreaded spawn mode for newsched
auto merge of #8221 : brson/rust/single-threaded, r=graydon

This is the last major runtime feature needed for the transition to the new scheduler.
Add SendDeferred trait and use it to fix #8214.
Fix nasty double-free bug where a newrt chan could get killed after rescheduling but before suppressing_finalize.
Fix embarrassing bug where 'unkillable' would unwind improperly when it receives a kill signal.
(cleanup) Use more do...finally in extra::sync.
Don't fail from kill signals if already unwinding.
Add an assert_may_sleep() check on every context switch.
auto merge of #8234 : bblum/rust/assorted-fixes, r=brson

This fixes 4 bugs that prevented the extra::arc and extra::sync tests from passing on the new runtime.

* In ```Add SendDeferred trait``` I add a non-rescheduling ```send_deferred``` method to our various channel types. The ```extra::sync``` concurrency primitives need this guarantee so they can send while inside of an exclusive. (This fixes deterministic deadlocks seen with ```RUST_THREADS=1```.)
* In "Fix nasty double-free bug" I make sure that a ```ChanOne``` suppresses_finalize *before* rescheduling away to the receiver, so in case it gets a kill signal upon coming back, the destructor is inhibited as desired. (This is pretty uncommon on multiple CPUs but showed up always with ```RUST_THREADS=1```.)
* In ```Fix embarrassing bug where 'unkillable' would unwind improperly``` I make sure the task's unkillable counter stays consistent when a kill signal is received right at the start of an unkillable section. (This is a very uncommon race and can only occur with multiple CPUs.)
* In ```Don't fail from kill signals if already unwinding``` I do pretty much what it says on the tin. Surprising that it took the whole suite of sync/arc tests to expose this.

The other two commits are cleanup.

r @brson
Revert "std::rt: Use a constant 4 threads for multithreaded sched tests"

This workaround was less than ideal. A better solution is to raise the
fd limit.

This reverts commit 49b72bdd77916e27aaf95909516702c1450f11ac.
Bump fd limit on macos when running rt tests

OS X defaults the ulimit for open files to 256 for programs launched
from the Terminal (GUI apps get a higher default). Unfortunately this is
too low for the rt tests, which deliberately overcommit and create a lot
of threads (which means a lot of schedulers, and each scheduler needs at
least 2 fds).

By calling sysctl() and setrlimit() we can bump the fd limit up to the
maximum allowed (on stock OS X it's 10240).

Fixes #7772.