[http] Avoid closing stdout (Fixes #3686)