Fix build error with GHC 7.6

Fixes build error caused by changes in IO error handling in GHC 7.6