registry: publish UnitState with TTL

Fix #783
server: only parse cfg.AgentTTL once