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.