when acquiring the lock, do the state transition first.

There was a tiny race here where two pids could get the same lock.
remove the sleep from after the log debug
move the dontkillme setting into show_backtrace

I still don't know why sometimes show_backtrace hangs for several
seconds. My guess is some fuzzing has corrupted the symbol table,
and the unwinder goes crazy. It always seems to coincide with
getting an empty trace.