Merge PR #35: keep listSessions from deleting state for live daemons (Closes #34)
listSessions() had two cleanup paths that ran regardless of whether
the recorded pid was still alive:
1. The .sock branch deleted the socket file whenever isSocketReachable
failed (500ms probe trips on busy daemon, transient EAGAIN, race
with a service restart). Once .sock was gone, the still-alive
daemon became invisible to every future scan with no recovery
short of kill -9.
2. The .json branch unconditionally deleted metadata older than 24h.
Long-lived daemons whose metadata wasn't refreshed (because nothing
refreshes it) had their .json removed after a day even though the
process kept consuming memory.
Both paths now gate on isProcessAlive(pid). If the pid is alive, the
state is kept. The TTL is meant to age out known-dead sessions, not
unknown-state ones; the kill(pid, 0) probe is one cheap syscall per
dead-looking session per scan.
Reported and fixed by @schickling-assistant. Includes regression
tests in tests/list-filters.test.ts that exercise both the live-pid
guard and the matched negative case where the 24h TTL still fires
when the pid is dead.