Introduce the "console" pool

This is a pre-defined pool with a depth of 1. It has the special property
that any task in the pool has direct access to the console. This can be
useful for interactive tasks or long-running tasks which produce status
updates on the console (such as test suites).
Merge pull request #714 from pcc/console-pool

Introduce the "console" pool
Allow SIGTERM for interruption.

Default signal sent by many other programs (mainly kill(1)) to gently
terminates another one is SIGTERM.
Forward interruption signal to child processes.
Suspend sub-processes when control-z is hit.

When control-z is hit the shell sends SIGTSTP to the front process group.
Generally it suspends all the process tree started by the command. But ninja
moves its sub-process to their own group so that it can stop them all on
interruption. This is a great improvement compared to make(1). However in such
a case sub-processes are not automatically suspended by the shell when you
hit control-z. Only ninja is and the command it has started keep running.
This patch addresses this issue by catching SIGTSTP and forwarding it to its
sub-processes groups. Thus, the entire ninja's process tree is suspended as
expected.

Thanks to Peter Collingbourne <peter@pcc.me.uk> for his help.
Merge branch 'sigterm' into my

* sigterm:
  Forward interruption signal to child processes.
  Allow SIGTERM for interruption.
Merge branch 'sigtstp' into my

* sigtstp:
  Suspend sub-processes when control-z is hit.
Work around pselect()/ppoll() failing to deliver handler.

In some rare cases, specially when executing long sequence of short command,
ninja does not respond to signal because its handlers are not triggered. This
happens on my linux box version 3.13-1-amd64.

This patch introduce --unprotected-syscall configure option to enable
implementation of ppoll() and pselect() based on poll() and select().
This implementation is similar to what ppoll()/pselect() does but not in an
atomic way. So theoretically there is a race condition. However since we do
not test for the "interrupted_" flag between the calls to sigprocmask() and
select()/poll() there is no race condition in practice. Most of the time
the signal is delivered when leaving sigprocmask() or when poll()/select()
returns EINTR.

See discussions:
- https://groups.google.com/forum/#!topic/ninja-build/leEnr095PeA
- http://lkml.iu.edu//hypermail/linux/kernel/1109.1/00609.html