Fix issue with test using blocking IO in the IO thread
Fix issue with stateful writes for large requests and responses