Interruptible read and write functions when GHC is at least 7.8