Avoid panic when aborting after an error

It is harmful to continue to use parts of the HTTP response "resp"
after an error has been signaled.