WHISTLE-42: handle agent state changes better
WHISTLE-1834: try to ensure the agent status is up to date before sending the agent update status API message