Fixed crash when clearing a TCP socket of data after it was already sent, fixed HTTP client not reconnecting properly when it times out.