Name worker threads using pthread_setname_np

This helps identify threads in gdb particularly in processes with a
lot of threads.