ws: Track when we sent an EOF to each agent

This prevents races while shutting down, and is a patch
that was accidentally not pushed in the earlier multi-agent
work.

Closes #443