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

Closes issue #1164.
diff --git a/Objects/intobject.c b/Objects/intobject.c
index c4aeed5..364947e 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -425,7 +425,10 @@
 int_print(PyIntObject *v, FILE *fp, int flags)
      /* flags -- not used but required by interface */
 {
-	fprintf(fp, "%ld", v->ob_ival);
+	long int_val = v->ob_ival;
+	Py_BEGIN_ALLOW_THREADS
+	fprintf(fp, "%ld", int_val);
+	Py_END_ALLOW_THREADS
 	return 0;
 }