Fix some error cases where a HTTP body might not be closed

Refs #2126
Merge pull request #2127 from titanous/close-body

Fix some error cases where a HTTP body might not be closed