session: ensure detach is done with worker barrier