Prevent agent crash on plugin exception

When a plugin throws an exception, the output is not a dictionary as required by the agent, resulting in agent exit. In the event of a plugin exception, the output is explicitly set to an empty dictionary.