goprotobuf: Fix Marshal crash on typed nil.

Also a bunch of other trivial updates.

R=r
CC=golang-dev
http://codereview.appspot.com/6501064
diff --git a/proto/encode.go b/proto/encode.go
index 2eec125..4e55816 100644
--- a/proto/encode.go
+++ b/proto/encode.go
@@ -196,6 +196,9 @@
 	}
 
 	t, b, err := getbase(pb)
+	if b == 0 {
+		return ErrNil
+	}
 	if err == nil {
 		err = p.enc_struct(t.Elem(), GetProperties(t.Elem()), b)
 	}