Build with GHC 7.8 on Windows

Switch to new GHC Handle API for GHC > 6.12
Replaces IOBase.FD with CInt as it isn't exposed any more

This change is needed to build on GHC 7.8. I've tried to compile it with GHC 6.10, 6.12, 7.0, 7.4, 7.6 (as well as 7.8.1 RC1) and it builds fine. The example program runs without crashing with GHC 7.8 but I haven't tested any more thoroughly than that.