threadpool: add jobid_fn kwarg to map()

Allows specifying a function that will be used to dynamically assign a
jobid for each task in the map operation. The jobid_fn is passed each
item in the map operation and should return a unique jobid each time
it's called.
always use jobid_fn kwarg to ThreadPool.map()