QPID-5869 Added a check to see if agent is null before firing the event.
There are other places in the code where this check is missing. Chuck will take care of them.

git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1607488 13f79535-47bb-0310-9956-ffa450edef68