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.

Merge includes patches that start adding improvements to ICAP parsing