num_workers should have been in the 'http' section and not in 'shardcached'
use pthread_create() instead of mg_start_thread()

the problem is that mg_start_thread() detaches the newly created thread
so we loose control on them and the possibility to join when leaving.