change fs.rmdir to rmdirSync to more reliably remove the tmp dir