http: Fix bug when using Connection: close and the new faster way of opening HTTP files

Fixes #2119
Fixes #2118