core: do not destroy core on interrupt, instead, just set is_destroying() to true.

Also, do not re-raise the signal. All intercepted signals are non-critical,
meaning that on receipt of these we can cleanly exit as well.
common: add a pseudo-semaphore implementation.

Possible operations are ::inc(), ::dec() and ::wait_for_zero().
core: use the pseudo-semaphore to wait for pulse threads as well.

Thus, when the program is interrupted, the core will not be torn down until
there are pulse threads in flight.
So the (apparently) last threading error is fixed.
log: get rid of horrible kludge under the name of "disabling assertions".