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