So if the script is terminated (^C) it will
wait for the child threads to join and clean up the temp file. Pressing ^C again during the pause will abort this. It also runs on a normal exit, saving the trouble of writing a
cleanup() function at every possible exit point.