ecmascript/http: If a request fails, make sure to clear out result

Fixes #2394