Prevent session nesting and add resource usage to stats
Detect when pty run is invoked inside an existing session via
PTY_SESSION env var and exec the command directly (-d bypasses).
Add CPU, memory, and PID reporting to pty stats for both the
child process and daemon.