Fix up signal handling (minimal shutdown) and log dumping.

Minimal shutdown is done, leaving the OS to clean up.
This avoids possibility of deadlocks while shutting down.

Deadlocks have been observed due to signals being raised while mutexes are
locked in various linked libraries; in particular, Mesa and the C++ library.
Curses by default (not Mac, not Windows client).