fixes #144

Seems like we are closing the reader too eagerly. We can delay closing
it until after we've processed the client's requests.
Merge pull request #145 from rgrinberg/master

fixes #144