Sensibly handle other returns from waitpid or waitid

The previous revision would always assume the tracee had exited once
waitpid() or waitid() returned, but this was not the case because it
also returns when the tracee receives any signal. This revision adds
code to sensibly handle other circumstances under which waitpid() or
waitid() might return. In particular, for an arbitrary signal that
doesn't need any special handling, the waiting functions now reinject
that signal into the tracee and set it to continue as if nothing
happened.
Check whether waitid() is enabled

This revision puts a preprocessor directive around the definition of
wait_using_waitid() so that it is only compiled if the waitid()
function actually exists.