setAgentDir() clears OMP_PROFILE/PI_PROFILE and snapshots the agent dir,
so restoring only PI_CODING_AGENT_DIR/HOME leaks the default profile to
later tests when the suite is started under a caller-selected profile.
Capture and restore all three env vars plus HOME, then rebuild the dir
resolver via __resetDirsFromEnvForTests() (disabled-extensions pattern).
Addresses review comment on PR #8018.