Do not pass a pointer to the threads.

Passing pointers of local storage to threads (especially a for loop
variable that changes quickly) ain't a good idea. Pass it by value
instead.