timeout and close connection when http client hasn't sent data in N seconds, various bugfixes associated with non-zero timeouts