fix compiler reader error reporting

  Stream slot was left unbound along one leg, which is bad because
  READER-ERROR is a subtype of STREAM-ERROR.
gencgc: i in add_new_area needs to be signed

  Regression from 7be8d1462a207bda809cd7553c5d76c6ebc4dda2,
  broke finalize.test.sh on x86 builds.

  Fixes lp#989958.
Better error messages to condition signalling functions.
gencgc: scale generation.bytes_consed_between_gc to number of gens

  This means we have by default 5% of total heap usable in the nursery
  between GCs, and another 5% of the total heap split between all the
  generations -- and roughly matches the nursery/old generation sizes
  relations from before the dynamic-space-size based scaling.

  Fixes lp#991293, regression since
  6848a92fd4af23d0695eeaaed9efcbdfd9e1d9e5.
tune bug-981106 test based on the heap size

  Fixes lp#983807.
redesign exiting SBCL

 Deprecate QUIT. It occupies an uncomfortable niche between processes
 and threads, and doesn't actually do what it says on the tin unless
 you call it from the main thread.

 SIGTERM now uses EXIT, and doesn't depend on sessions.

 WITH-DEADLINE (:SECONDS NIL :OVERRIDE T) can now be used to ignore
 deadlines.

 JOIN-THREAD on the main thread now blocks indefinitely instead of
 claiming the thread did not exit normally.

 New functions:

  * SB-EXT:EXIT. Always exits the process. Takes keywords :CODE,
    :ABORT, and :TIMEOUT. Code is the exit status. Abort controls if
    the exit is clean (unwind, exit-hooks, terminate other threads) or
    dirty. Timeout controls how long to wait for other threads to
    finish.

  * SB-THREAD:RETURN-FROM-THREAD. Normal termination for current
    thread -- equivalent to return from the thread function with the
    specified values. Takes keyword :ALLOW-EXIT, which determines if
    returning from the main thread is an error, or equivalent to
    calling EXIT :CODE 0.

  * SB-THREAD:ABORT-THREAD. Abnormal termination for current thread --
    equivalent to invoking the initial ABORT restart estabilished by
    MAKE-THREAD (previously known as TERMINATE-THREAD, but ANSI
    recommends there to always be an ABORT restart.) Takes keyword
    :ALLOW-EXIT, which determines if aborting the main thread is an
    error, or equivalent to calling EXIT :CODE 1.

  * SB-THREAD:MAIN-THREAD-P. Let's you determine if a given thread is
    the main thread of the process. This is important for some
    functions on some operating systems -- and RETURN-FROM-THREAD and
    ABORT-THREAD also need it.

  * SB-THREAD:MAIN-THREAD. Returns the main thread object. Convenient
    for when you need to eg. load a foreign library in the main
    thread.
add SB-UNIX:UNIX-EXIT back, use the deprecation framwork for it and SB-EXT:QUIT

  Also extend the deprecation framwork to support multiple replacements:
  SB-EXT:QUIT should be replaced either by SB-EXT:EXIT or SB-EXT:ABORT-THREAD,
  depending on the way it was being used.
Fix the DEFTRANSFORM of RANDOM for hairy integer types.

With integer types that are neither an interval nor a single known value
the DEFTRANSFORM used to generate an expression that had two problems:
First, it yielded very uneven distributions of random values for most
arguments to RANDOM that are not very small. Second, it used a too small
RANDOM-CHUNK under 64 bits word size thus never generating numbers
larger than (1- (EXPT 2 32)) even if RANDOM's argument was larger than
(EXPT 2 32).

Fix this by giving up the transform in these cases.

Add a new file "tests/random.pure.lisp" containing tests for this.
Add some tests for basic RANDOM functionality.

There are currently few, if any, such tests, so ahead of profound
changes to integer RANDOM add some. They are neither systematic nor
comprehensive but should be better than nothing.
Better equidistributed and faster/less consing integer RANDOM.

Up to now the implementation of RANDOM with an integer argument just
generated a few more random bits than the length of the argument and
took this value MOD the argument. This led to a slightly uneven
distribution of the possible values unless the argument was a power of
two. Moreover, for bignums, the algorithm was quadratic both in time and
space dependent on the number of bits of the argument.

Instead generate random integers using an accept-reject loop and change
the bignum implementation to an algorithm that is linear in time and
space.

I took some inspiration from WHN's attempt at an accept-reject loop
implementation in commit 0a7604d54581d2c846838c26ce6a7993629586fa and
following.

Thanks to Christophe Rhodes for reviewing this patch!

Some details:

The implementation works correctly with both a random chunk size equal
to the word size and equal to half the word size. This is currently
necessary as a 32-bit pseudo random generator is used both under 32 and
under 64 bit word size.

In the generic RANDOM case, fixnum and bignum limits are differentiated:

With a fixnum limit an accept-reject loop on a masked random chunk is
always used. Under 64 bit word size two random chunks are used only if
the limit is so large that one doesn't suffice. This never conses.

With a bignum limit four cases are differentiated to minimize consing.
If just one random chunk is needed to supply a sufficient number of bits
the implementation only conses if the result is indeed a bignum:
* If the limit is a power of two, a chunk is generated and shifted to
  get the correct number of bits.
* If the limit is not a power of two an accept-reject loop with shifting
  is used.
If more than one random chunk is needed, a bignum is always consed even
if it happens to normalize to a fixnum:
* If the limit is a power of two a straightforward algorithm is used to
  fill a newly created bignum with random bits.
* If the limit is not a power of two an accept-reject loop is used that
  detects rejection early by starting from the most significant bits,
  thus generating on the average only one random chunk more than needed
  to fill the result once.
The test for power of two is non-consing, too.

In the case of a compile-time constant integer argument (of at most word
size) a DEFTRANSFORM triggers, that, in the general case, compiles an
accept-reject loop. For values of the limit where this sufficiently
reduces the rejection probability the largest multiple of the limit
fitting in one or two random chunks is used instead inside the loop.
To bring the result in the correct range a division is then necessary
(which the compiler converts into a multiplication). Powers of two are
optimized by leaving out the rejection test. In those cases where a word
has more bits than a random chunk, the generated expression uses two
chunks only if necessary.
runtime clean up.

coreparse.c: Move #define _BSD_SOURCE up, so that it won't conflict
with subsequent files, and #undef it after it's used to
include sys/mman.h

search.c(search_for_type): Remove unused variable addr.

interrupt.c: Remove double parentheses in if((x==y)).

run-program.c: Include sys/wait.h
sb-posix: abort(3), exit(3), and _exit(2)

  Also fix docstring of SB-EXT:EXIT, which referred to exit as being section 2.
more deprecation

 * Add "Deprecated Interfaces" chapter to the manual.

 * Add list of deprecated interfaces along with a policy note to a comment
   near DEFINE-DEPRECATED-FUNCTION.

 * Add a proper deprecation warning for SB-C::MERGE-TAIL-CALLS.

 * Fix the deprecation warning for WITH-SPINLOCK. (Accidentally referred to
   WITH-RECURSIVE-SPINLOCK before.)
clock_nanosleep based SLEEP on Posix platforms

  Looping around nanosleep() isn't a winning solution: we don't know if the
  remainder from nanosleep reflects the time spent in signal handler or not.

  Keep the nanosleep() based version around for Darwin and other
  non-conformant platforms: :OS-PROVIDES-CLOCK-NANOSLEEP tells us if we need
  to use it or not.

  Since neither clock_nanosleep nor nanosleep is guaranteed to be asynch
  signal safe, add a test-case that tries to hang them via nesting.  My theory
  is that in practise they both /are/ asynch signal safe...

  FIXME: Stress test fails!