Track more task state that we need to restore on deepforking.

#603.  Was in the middle of writing deepfork when I remembered we're not tracking this stuff yet.  This should be the last yak-shaving patch.