Preserve HTTP status when handshake fails.

Without this fix the reported status code is always 500, even
though the server might have responded with a different code,
e.g. 401.