Run signal handlers in a thread to prevent deadlocks

Steno takes a lock when writing log messages. When a signal handler runs
it can pre-empt this code while the lock is still active. When the trap
handler then tries to log it attempts to grab the same lock, and
deadlocks. We've seen this cause hangs during shutdown when we upgrade
DEAs.

Ideally I would've just removed the log message, since signal handlers
should avoid doing things that need to take locks, but there's enough
logic in here that I can imagine other things rely on locks, so the
safest solution seems to be spawn a thread.
Use thread join to avoid sleeping in the code

Signed-off-by: Michael Fraenkel <fraenkel@us.ibm.com>