This closes patch:

[ 960406 ] unblock signals in threads

although the changes do not correspond exactly to any patch attached to
that report.

Non-main threads no longer have all signals masked.

A different interface to readline is used.

The handling of signals inside calls to PyOS_Readline is now rather
different.

These changes are all a bit scary!  Review and cross-platform testing
much appreciated.
diff --git a/configure.in b/configure.in
index 7e13874..5503a17 100644
--- a/configure.in
+++ b/configure.in
@@ -2783,6 +2783,11 @@
   [Define this if you have flockfile(), getc_unlocked(), and funlockfile()])
 fi
 
+# check for readline 2.1
+AC_CHECK_LIB(readline, rl_callback_handler_install,
+	AC_DEFINE(HAVE_RL_CALLBACK, 1,
+        [Define if you have readline 2.1]), , -ltermcap)
+
 # check for readline 2.2
 AC_TRY_CPP([#include <readline/readline.h>],
 have_readline=yes, have_readline=no)
@@ -2804,6 +2809,17 @@
 	AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1,
         [Define if you have readline 4.2]), , -ltermcap)
 
+# also in readline 4.2
+AC_TRY_CPP([#include <readline/readline.h>],
+have_readline=yes, have_readline=no)
+if test $have_readline = yes
+then
+  AC_EGREP_HEADER([extern int rl_catch_signals;],
+  [readline/readline.h],
+  AC_DEFINE(HAVE_RL_CATCH_SIGNAL, 1,
+  [Define if you can turn off readline's signal handling.]), )
+fi
+
 AC_MSG_CHECKING(for broken nice())
 AC_CACHE_VAL(ac_cv_broken_nice, [
 AC_TRY_RUN([