Add support for NetBSD threads in i386-bsd-nat.c
NetBSD ptrace(2) accepts thread id (LWP) as the 4th argument for threads.
Define gdb_ptrace() a wrapper function for ptrace(2) that properly passes
the pid,lwp pair on NetBSD and the result of get_ptrace_pid() for others.
gdb/ChangeLog:
* i386-bsd-nat.c (gdb_ptrace): New.
* (i386bsd_fetch_inferior_registers,
i386bsd_store_inferior_registers) Switch from pid_t to ptid_t.
* (i386bsd_fetch_inferior_registers,
i386bsd_store_inferior_registers) Use gdb_ptrace.