fix: pty kill waits for daemon exit; daemon shutdown doesn't resurrect removed metadata (#69)
Low-pri teardown cleanup. On teardown the daemon re-flushes exit metadata during
its (possibly watchdog-delayed) shutdown; a caller returning before that finishes
could see a stray registry temp file. Diagnosed: the ~8s residue is the
spawner-watchdog path (5s poll), not explicit `pty kill` (which re-flushes in
~50ms).
(A) `pty kill` now waits for the daemon pid to fully exit (bounded 3s) before
returning, so a following `pty rm` can't race the daemon's late write.
- sessions.ts: export isProcessAlive + add waitForProcessExit().
(ii) The daemon's saveExitMetadata() is now a no-op when the session's `.json`
was already removed — a late shutdown/watchdog flush won't resurrect a
`pty rm`'d session's file (or leave its atomic tmp behind). Normal exits are
unaffected (the metadata exists at exit).
Tests: tests/kill-wait.test.ts — daemon gone by the time kill returns; kill→rm
leaves no stray files; daemon shutdown doesn't resurrect removed metadata. Also
hardened tests/seq-delay.test.ts's timing assertion (bigger delay signal) so it
doesn't false-fail under a saturated parallel run.
Not done (per cos): didn't shorten the watchdog poll (behavior change for a
cosmetic gain).