Fix build on ghc-6.12.3.
Include termios.h on Android because winsize is defined in it.

Patch from Nathan Hüsken.
Add 'catches' to MonadException.  Patch from Håkan Thörngren.
Merge http://code.haskell.org/haskeline into ghc-head
Avoid shadowing `handlers` variable in `catches`