registry: publish UnitState with TTL

Fix #783
server: only parse cfg.AgentTTL once
Merge pull request #788 from bcwaldon/783

registry: publish UnitState with TTL