Add flushCookieJar, flushCache and flushAllHttpState, close #1617