test: thread: make halt_pred_test properly robust

I.e. fewer ineffective ThreadSwitch calls replaced with a single 100-µs sleep
to ensure that receive_and_die_fn() runs until exception.
testbench: move streq() into defs.h
test: thread: add tests on lost pager and exceptionhandler in receive phase

These should be extended to have the pager or exh disappear in the send phase
as well; that would test abort_waiting_ipc()'s send part also.
ipc: change abort_waiting_ipc() to accept a ThreadId

Instead of a <struct thread *>. This is because thread deletion destroys the
thread structure before IPC hooks are aborted, and because the whole thread
structure isn't actually required.

Also, ipc_user() was altered to always set the global thread ID in
ipc_{to,from}, which is necessary for matching in abort_thread_ipc() and
abort_waiting_ipc(). This convention should be followed by sys_ipc() and every
other mutator of those fields as well: ordinary IPC should also be aborted
when the peer is lost.
exception: handle failed IPC in pf & exn hook functions

This makes the "lost pager" and "lost exceptionhandler" tests pass.