Add a bunch of GIL release/acquire points in tp_print implementations and for
PyObject_Print().

Closes issue #1164.
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 92bad8c..a3fa983 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -282,19 +282,28 @@
 	if (rc != 0) {
 		if (rc < 0)
 			return rc;
+		Py_BEGIN_ALLOW_THREADS
 		fprintf(fp, "[...]");
+		Py_END_ALLOW_THREADS
 		return 0;
 	}
+	Py_BEGIN_ALLOW_THREADS
 	fprintf(fp, "[");
+	Py_END_ALLOW_THREADS
 	for (i = 0; i < Py_Size(op); i++) {
-		if (i > 0)
+		if (i > 0) {
+			Py_BEGIN_ALLOW_THREADS
 			fprintf(fp, ", ");
+			Py_END_ALLOW_THREADS
+		}
 		if (PyObject_Print(op->ob_item[i], fp, 0) != 0) {
 			Py_ReprLeave((PyObject *)op);
 			return -1;
 		}
 	}
+	Py_BEGIN_ALLOW_THREADS
 	fprintf(fp, "]");
+	Py_END_ALLOW_THREADS
 	Py_ReprLeave((PyObject *)op);
 	return 0;
 }