Fix IO related deadlock

Read responses to commands issued to the redirector process only once we know that the request was parsed at the other end and a response sent.