Gently handle dying workers with sessions.

When a worker unexpectedly dies while having active sessions, these
sessions must be detached and their clients should have been signalled
with an error condition on their corresponding upstreams.

First, some clients try to immediately reschedule their jobs, but the
current worker is not yet marked as inactive, so these new jobs can land
on this dying worker, if we decide to assign the job on a worker right
away. Mark the worker as inactive before cancelling its sessions.

Second, session is detached before the error handler is called on the
upstream. If the downstream is then closed in the upstream error
handler, then it tries to send 'choke' to a detached session. Detach
streams after the error handling.