Catch socket.timeout when attempting urlopen