Added support for counting process threads

Hey guys, I needed to count the number of threads of some process, maybe it's useful for someone else.