registry: publish UnitState with TTL

Fix #783