Close API clients when the runtime shuts down to release HTTP connection pool resources, and surface the active session ID in /session output.
Cherry-picked from PR #273. Excluded the embedded-wrapper session resolver and memory parser API changes because they need a narrower public API design.