Switch to new GHC Handle API for GHC > 6.12
Replace IOBase.FD with CInt as it isn't exposed any more