various cleanup of NMAgentManager
use CList for tracking secret agents
fix races to register/unregister agents.