agent: send unit events only when necessary
Merge pull request #692 from bcwaldon/unit-state-filtering

agent: send unit events only when necessary