Update threadpool.c to avoid crash..

Modified the thread_count when pthread_create fails to avoid crash in threadpool_destroy.