Fix a proto encoding crasher whereby a nil in a repeated group field would crash the server.

Also fix the reflect bug that was exposed by this bug.

R=r
APPROVED=rsc
DELTA=162  (103 added, 32 deleted, 27 changed)
OCL=30125
CL=30319
diff --git a/src/pkg/reflect/all_test.go b/src/pkg/reflect/all_test.go
index 903b0f5..987acd4 100644
--- a/src/pkg/reflect/all_test.go
+++ b/src/pkg/reflect/all_test.go
@@ -611,3 +611,10 @@
 		t.Errorf("Set(234) changed i to %d", i.(int));
 	}
 }
+
+func TestNilPtrValueSub(t *testing.T) {
+	var pi *int;
+	if pv := NewValue(pi).(PtrValue); pv.Sub() != nil {
+		t.Error("NewValue((*int)(nil)).(PtrValue).Sub() != nil");
+	}
+}