Fixes #5579: Send reports from the agent to provide a heartbeat

This PR is a proposal to replace #563.
This solution does not work.
During parsing, CFEngine notice that this class is always defines, so defines it upfront, causing the endRun to be always sent