Fix inability to close pipe in "expecting chunk" state

When doing a blocked read and EINTR occurs, the server state
was stuck in expecting chunk, and would't accept a close
command.
Merge pull request #28 from rpedde/close-after-eintr-or-timeout

Fix inability to close pipe in "expecting chunk" state