Fix some error cases where a HTTP body might not be closed Upstream-commit: d30806590c8436941e5c4f2349af61de0128c49e Component: engine