[proxy] fix NULL access in case the upstream connection timed out