Fix unit test failure: connection is nil in finalize_request if it has been hijacked