upload_symbols: catch socket.error exceptions

The socket module itself can raise exceptions which sometimes aren't
caught by the modules we use (like httplib).  Make sure we catch them
ourselves to avoid killing uploads like:

Traceback (most recent call last):
...
  File "/b/cbuild/stumpy-canary-master/chromite/third_party/poster/streaminghttp.py", line 142, in http_open
    return self.do_open(StreamingHTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1180, in do_open
    r = h.getresponse(buffering=True)
  File "/usr/lib/python2.7/httplib.py", line 1030, in getresponse
    response.begin()
  File "/usr/lib/python2.7/httplib.py", line 407, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
    line = self.fp.readline()
  File "/usr/lib/python2.7/socket.py", line 447, in readline
    data = self._sock.recv(self._rbufsize)
error: [Errno 104] Connection reset by peer

BUG=chromium:329260
TEST=`./scripts/upload_symbols_unittest.py` passes
TEST=`upload_symbols --testing --board x86-alex --yes` shows it handling this new exception

Change-Id: I335dacdf79b1c2a655062c3dabf7503f33089c54
Reviewed-on: https://chromium-review.googlesource.com/183640
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/upload_symbols.py b/scripts/upload_symbols.py
index db68308..18b34a6 100644
--- a/scripts/upload_symbols.py
+++ b/scripts/upload_symbols.py
@@ -18,6 +18,7 @@
 import os
 import poster
 import random
+import socket
 import textwrap
 import tempfile
 import time
@@ -143,6 +144,7 @@
                                         returncode=returncode)
   if returncode:
     exceptions = (
+        socket.error('[socket.error] forced test fail'),
         httplib.BadStatusLine('[BadStatusLine] forced test fail'),
         urllib2.HTTPError(upload_url, 400, '[HTTPError] forced test fail',
                           {}, None),
@@ -261,7 +263,7 @@
     except urllib2.HTTPError as e:
       cros_build_lib.Warning('could not upload: %s: HTTP %s: %s',
                              os.path.basename(sym_file), e.code, e.reason)
-    except (urllib2.URLError, httplib.HTTPException) as e:
+    except (urllib2.URLError, httplib.HTTPException, socket.error) as e:
       cros_build_lib.Warning('could not upload: %s: %s',
                              os.path.basename(sym_file), e)
     finally: