Fix incorrect handling of timeouts on outgoing HTTP requests.