threads: Pass env through to thread_exec
We want to start running rr on CI, but at the moment the threads
test is clearing ENV, causing it to lose the LD_PRELOAD that improves
rr performance. Fix that by instead passing through the environment
and setting the relevant JULIA_NUM_THREADS flag on top of it.