Tighten up thread safety of the ServletOutputStreamImpl
Add test for servlet input stream, and lots of fixes