Refactor ThreadIds_internal

Change System.Diagnostics.Process.ThreadIds_internal to determine the number
of threads, rather than receive the number as an argument from the managed
code.