Fix deadlocks in readProcessWithExitCode

The problem is in the exception handler in readProcess. When it receives
an asynchronous exception, it tries to clean up by closing the pipes.
However the attempt to close outh blocks because the reader thread
(reading with hGetContents) is blocking on the handle.

See https://ghc.haskell.org/trac/ghc/ticket/8343 for the corresponding
ticket for the process package.
Merge pull request #2 from takano-akio/deadlocks

Fix deadlocks in readProcessWithExitCode