Fix deadlocks in readProcessWithExitCode

 The following program should terminate in 1 second, but it does not:

```haskell
{-# LANGUAGE OverloadedStrings #-}        
import System.Process.ByteString
import System.Timeout

main = timeout 1000000 $
  print =<< readProcessWithExitCode "sleep" ["2h"] ""
```

Please see https://ghc.haskell.org/trac/ghc/ticket/8343 for the corresponding ticket for the process package.