move the 'block on fd' check out of the signal handler
add a bust_locks function.

As the comment implies, this isn't going to be generally useful,
and should only be used in rare circumstances.
on return from signal handler, drop the syscall lock if we had it.
function reordering in lock.c

(to make subsequent diffs easier to read)
fix a case where the watchdog code would hang on a lock
handle the case where we double acquire a lock.

Shouldn't happen now that we do the bust_locks() after the signhandler,
but just in case, add some debug code to catch any stupidity that might
creep in later.
update the syscall rec timeval under the record lock.
only increment total_syscalls_done after we completed a syscall.
resurrect the old backtrace code.

It's not always useful, but from time to time it does actually work
and can be useful for tracking down weird cases.
the backtrace functions need -rdynamic to be passed to the compiler
dump backtrace if we detect a double lock.
provide a way for children to become immune from the watchdog killer
disable child killing when we're dumping backtraces.

in part because of the sleeping we do here, but also because sometimes
it takes a while for backtrace() to gather all the symbols.
It's a mystery to me tbh.
clear out child data from previous instances of the same child.
watchdog: replace ptr to timeval with a ptr to the syscall record.
watchdog: calculate diff correctly if we wrap.
change wrap calculation to factor in possiblity of adjtime