runtime: reset dangling typed pointer
+untype it because it can point to different types
Update #5193.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/8454043
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index 438de78..0a131871 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -1178,6 +1178,7 @@
 	if(m->waitunlockf) {
 		m->waitunlockf(m->waitlock);
 		m->waitunlockf = nil;
+		m->waitlock = nil;
 	}
 	if(m->lockedg) {
 		stoplockedm();
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h
index 864b2aa..bafad35 100644
--- a/src/pkg/runtime/runtime.h
+++ b/src/pkg/runtime/runtime.h
@@ -317,7 +317,7 @@
 	bool	needextram;
 	void*	racepc;
 	void	(*waitunlockf)(Lock*);
-	Lock*	waitlock;
+	void*	waitlock;
 	uint32	moreframesize_minalloc;
 
 	uintptr	settype_buf[1024];