Check error before defer response body close
Merge pull request #7 from kmchen/master

Check error before defer response body close