realtime.in:  fix shm checking

Test for shmdrv applicability updated (again :P)
realtime:  thorough shmdrv checks; DEBUG value always decimal

Unload() was leaving the shmdrv module behind when segments were
allocated, even if not open.

FIXME:  this case needs to be clarified; see
    https://github.com/zultron/linuxcnc/issues/36

CheckShm() now takes an argument for which specific shmdrv check:
     -l: return success if shmdrv device exists
     -w: wait for shmdrv to be loaded; return success if loaded
     -a: return success if any segments allocated
     -o: return success if any segments open

Also, always set $DEBUG to some decimal number.
realtime.in:  more thorough CheckStatus() checks

user threads, check for running rtapi_app and rtapi_msgd

detailed shmdrv checks
realtime:  revert extended shmdrv tests

We don't care who's using shmdrv, just try to remove it at unload
time, and move on whether it succeeds or fails.
Fix gcc multilib bug in precise

http://gcc.gnu.org/ml/gcc/2012-02/msg00314.html

- Check for bug in configure script
- Pass fix through Makefile.inc to Makefile to rtapi/xeno_math/Makefile
- Call kbuild with fix
Undo hack to overrun test

This commit broke the overrun test:  05c8f859

This hack fixed it:  e3237db6

After the 'autoload' feature, 05c8f859 was reversed:  164647d4

Now the overrun test is breaking on the buildbots, even though not on
my various test environments.

This commit reverses 05c8 because it's right, and hopefully the
buildbots will stop getting hosed on this test.
docs: shmdrv notes in UnifiedBuild.txt
rtapi_shm/kthreads: make shm key honor instance id
rtapi_proc: add /proc/rtapi/instance

Needed for instance id coordination during startup and shutdown.

See https://github.com/zultron/linuxcnc/issues/36#issuecomment-21643854
rtapi_compat.c: add kernel_instance_id() method
rtapi_msgd: reorganize startup sequence

msgd will now fork and go into the background once everything is set up
correctly, otherwise fail immediately with a non-zero exit value.

Use stderr, and switch to syslog only post-fork, so we get decent
diagnostics from scripts/realtime.

Before forking, make a stab at diagnosing and repair of problems with
instance collistion and leftover shared memory segments.
scripts/realtime: simplify startup by shifting checks to rtapi_msgd
scripts/realtime: enable passing options to shmdrv through SHMDRV_OPTS