decremented exit guard when failed to write header
Added test for connection already closed on server response
Merge pull request #37 from maedama/hotfix/exit_guard_count_miss

decremented exit guard when failed to write header