Work around deficiencies in POSIX timers

According to the documentation for timer_delete:

  The treatment of any pending signal generated by the deleted timer is
  unspecified.

In practice, this seems to mean that the profiling timer can fire
several times before the thread notices that the timer was actually
deleted. And if the luasandbox_timer_callback_data gets freed in the
mean time, boom. Thanks, POSIX.

To work around this, keep an array of static luasandbox_timer structs
around for use by the profilers, and use semaphores to synchronize
access too. And for good measure, block signals when deleting the other
timers and make sure any pending signals get processed before returning.

Change-Id: I8ef7f38ddc1423c65b09503ed768d82d30ee02b2