Got test_pickletools and test_pickle working.
(Alas, test_cpickle is still broken.)
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index 00641d8..639e68b 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -5241,6 +5241,13 @@
 		goto finally;
 
 	res = PycStringIO->cgetvalue(file);
+        if (res == NULL)
+		goto finally;
+	if (!PyBytes_Check(res)) {
+		PyObject *tmp = res;
+		res = PyBytes_FromObject(res);
+		Py_DECREF(tmp);
+	}
 
   finally:
 	Py_XDECREF(pickler);