add try..finally to chdir
add try..finally to chdir

kate-v-stepanova/scilifelab,kate-v-stepanova/scilifelab,senthil10/scilifelab,kate-v-stepanova/scilifelab,jun-wan/scilifelab,kate-v-stepanova/scilifelab,jun-wan/scilifelab,SciLifeLab/scilifelab,SciLifeLab/scilifelab,jun-wan/scilifelab,jun-wan/scilifelab,SciLifeLab/scilifelab,senthil10/scilifelab,senthil10/scilifelab,senthil10/scilifelab,SciLifeLab/scilifelab