Fix build error with GHC 7.6

Fixes build error caused by changes in IO error handling in GHC 7.6
Merge pull request #1 from jstolarek/ghc-7.6

Fix build error with GHC 7.6