Catch some additional exceptions from urllib3 and socket
Fix header encoding problems