runtime/cgo: runtime changes for new cgo

Formerly known as libcgo.
Almost no code here is changing; the diffs
are shown relative to the originals in libcgo.

R=r
CC=golang-dev
https://golang.org/cl/3420043
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index ff8673a..3d5ee24 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -8,6 +8,8 @@
 #include "malloc.h"
 #include "os.h"
 
+bool	runtime·iscgo;
+
 static void unwindstack(G*, byte*);
 
 typedef struct Sched Sched;
@@ -426,8 +428,11 @@
 			runtime·allm = m;
 			m->id = runtime·sched.mcount++;
 
-			if(libcgo_thread_start != nil) {
+			if(runtime·iscgo) {
 				CgoThreadStart ts;
+
+				if(libcgo_thread_start == nil)
+					runtime·throw("libcgo_thread_start missing");
 				// pthread_create will make us a stack.
 				m->g0 = runtime·malg(-1);
 				ts.m = m;