Revise threadpool implementation to eliminate spurious wake-up issues and get_thr_arg NULL warnings.

Thanks to Jacob Anderson <jwa@beyond-ordinary.com> for pthread suggestions