chore: use defer instead of t.Cleanup
for chdir
#6887
Merged
t.Cleanup
for chdir
#6887