inputhook: make PyQt4 plays nicer with pyreadline
inputhook: make PyQt4 plays nicer with pyreadline

PyQt4's own input hook is not really appropriate when PyReadline is active
(and possibly other readline packages running the PyOS_InputHook repeatedly).
Arguably this should be fixed in PyQt4 itself, but in the meantime we can
install a local hook which does the Qt event loop processing in a less
aggressive way.

ipython/ipython,ipython/ipython