Better handling of exceptions from the py socket library
Better handling of exceptions from the py socket library

Summary:
Sometimes the exception raised from the socket library
has a "message" attribute but does not set "errno" or "strerror".
I tested various combinations of OSError and socket.error with and
without errno/strerror/message values, and using `str(e)` always
does something reasonable.

Reviewed By: yfeldblum

Differential Revision: D6848656

fbshipit-source-id: f411e2b846eea98a4bcfc177cbec10db6e4e84de

facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift