CA-151605: Fix race in host_dead_hook

If any tasks are destroyed or GCed after getting the list of tasks but
before finding the host to which they were forwarded, the
host_post_declare_dead hook script will not actually be called.