lib/work: provide wrappers of pthread for better logging

Currently some components of sheepdog uses pthread_create()
directly. But this usage introduces diagnose unfriendly log. The below
line is an example:

Jul 27 20:59:36   INFO [main] http_main_loop(325) http main loop

The function http_main_loop() is called in a worker thread but its
prefix is [main]. Because The worker thread doesn't change its TLS
variable worker_name (which is initialized by set_thread_name()). This
patch adds a new wrapper sd_thread_create(), which wraps
pthread_create() and let the worker threads set correct
worker_name. Below line is a changed one:

Jul 27 21:33:27   INFO [http] http_main_loop(325) http main loop

This patch also introduces below wrappers:
 - sd_thread_join(): a wrapper for pthread_join(), because pthread_t
   is not used directly anymore
 - sd_thread_create_with_idx(): another wrapper of pthread_create()
   which produces several threads from single function

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
checkpatch: wran on direct calling of pthread_create()

Basically developers shouldn't use the function directly.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>