For FreeBSD, determine the main thread earlier.
Add logic to gdb interface to not pass thread id if has not be determined
gdb will use the process id as if it was a thread id, so add the process id
to the thread query function.