[V2] Fix avocado tmp directory security issue

Fix the avocado tmp directory security issue pointed by @adereis.