See if this fixes random errors by making tempfiles threadsafe.