Remove syscall(2) use.

Add support for detecting the primordial thread.

Index: hotspot/src/os/bsd/vm/os_bsd.cpp
--- hotspot/src/os/bsd/vm/os_bsd.cpp.orig
+++ hotspot/src/os/bsd/vm/os_bsd.cpp
@@ -1285,7 +1285,7 @@ pid_t os::Bsd::gettid() {
   return (pid_t)tid;
 #endif
 #elif defined(__OpenBSD__)
-  retval = syscall(SYS_getthrid);
+  return ::getthrid();
 #elif defined(__NetBSD__)
   retval = (pid_t) _lwp_self();
 #endif
@@ -4590,6 +4590,12 @@ void os::pause() {
       "Could not open pause file '%s', continuing immediately.\n", filename);
   }
 }
+
+#ifdef __OpenBSD__
+bool os::is_primordial_thread() {
+  return (pthread_main_np() == 1);
+}
+#endif
 
 
 // Refer to the comments in os_solaris.cpp park-unpark.
