Keep track of open/closed handles to avoid calling the blocking hIsOpen function
Updated example Main.hs
New dependencies + -threaded GHC flag