[connectionagent] make connectToType work correctly.

If type is already connected, don't popup dialog.