[connectionagent] add initial plugin test, and fix nasty crash it found.