Resolve a ref leak in threadpool.c