HLS's tests sometimes trigger Language server unexpectedly terminated,
which means the pipe might be closed before we cancel the consuming thread.
I believe I find one of the cause.
runSession' :: ...
...
...
...
finally (timeout msgTimeoutMs (runSession' exitServer))
-- Make sure to kill the listener first, before closing
-- handles etc via cleanupProcess
(killThread tid >> cleanup)
Since killThread tid = throwTo tid ThreadKilled, it won't wait for the target thread to exit.
Fix can be trival, simply use async instead of forkIO and use cancel instead of killThread