rtapi_pci: export PCI replacement symbols explicitly
rtapi_pci: dont core dump in pci_unregister_driver() if a pci_register_driver() failed
rtapi/userthreads/pci: assure PCI support properly linked

rtapi_pci.o got lost along the way
rtapi.h: make rtapi_set_msg_handler() visible to both ULAPI and RTAPI

the message handler can be set in either environment and is applicable
only in that environment

This gets rid of the need to compile rtapi_app.cc with -DRTAPI.
rtapi_app: dont link with -ludev and -DRTAPI

technically rtapi_app isnt RTAPI or ULAPI; just the RT modules loaded
by rtapi_app are 'RTAPI' (meaning to have the RTAPI symbol space not to
shared with rtapi_app proper).

for convenience it's fine to use -DULAPI.
rtapi_compat.c: strengthen Xenomai vs RTAI test

/sys/module/xeno_nucleus/parameters/xenomai_gid is telltale for Xenomai
rtapi_compat.c: add xenomai_id(), user_in_xenomai_group() functions

useful for startup checks against installation issues
rtapi.h/rtapi_compat.h: factor out utility functions into rtapi_compat.h

rtapi_compat.c contains functions which are at the RTAPI layer but
not technically RTAPI or ULAPI module functions, rather helpers
for startup, shutdown, and flavor management.
rtapi_app: switch to factored-out functions in rtapi_compat.c
include rtapi_compat.h where needed

delete unused rtapi_kdetect.h references
startup/rtapi_msgd: catch xenomai install issue
rtapi_msgd: refuse to run as root, or setuid root

User energy in fixing perceived problems seems limitless.
rtapi_app: remove unused code
rtapi_app: refuse to run as root, improve setuid detection
scripts/realtime: use sh idioms
scripts/realtime: workaround for https://github.com/zultron/linuxcnc/issues/49

this is a stopgap measure, the cause still needs to be identified
rtapi/kthreads: trap https://github.com/zultron/linuxcnc/issues/49 early

this needs to be cleaned up once the cause is found
hal_lib/ulapi shutdown: explicitly terminate ulapi instead of through dtor

this caused a segfault on shutdown of ulapi programs with 3.5.7-rtai only,
although the code was problematic to start with: there were two dtors
at work, one for the hal library, and one for ulapi. Depending on the
the relative sequencing of destructors (void  __attribute__ ((destructor))func())
it would happen that the ulapi layer was terminated before the hal_lib
constructor was called, failing in rtapi_shm_delete because rtapi_switch
was pointing to methods in an already unloaded ulapi-<flavor>.so .

The fix is as follows:
- make ulapi layer termination explicit through ulapi_cleanup()
- assure ulapi_cleanup() reverts the rtapi_switch pointer to the dummy
  dummy switch struct, which will give a clear error message instead of
  a segfault when for instance ulapi is terminated before hal_lib by a
  programming error
- assure ulapi_cleanup() reverts the autoload layer to pristine state so
  the autoload function becomes serially reusable. This is not currently
  used but better safe than sorry.
configure.in: rtai_fifos.ko and rtai_sem.ko are not used anymore
rtapi/xenomai kernel/math: add ceil()

needed by sim_spindle and orient