crospts: Move deleting temp directory to ExitStack

If exception happens before the deleting temp folder, the removing
function will not be executed. Move the deleting temp directory to
ExitStack to ensure it will be executed.

BUG=None
TEST=./run_crospts.py -p ctxclock <DUT> with exception, and check the
temp directory was deleted.

Change-Id: I89d6ea9dbae145e6fa6aad76b293cbc5aa4a4326
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crospts/+/5265999
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Darren Wu <darrenwu@chromium.org>
Tested-by: Darren Wu <darrenwu@chromium.org>
1 file changed
tree: f2b8e725c2dc474d80d5b63e8595630eb553ef2b
  1. build/
  2. docs/
  3. tools/
  4. .gitignore
  5. DIR_METADATA
  6. OWNERS
  7. PRESUBMIT.cfg