[1.9.x] Allow users to override connection keep alive logic

Creates the extension point requested in #733 by moving the HTTP 1.1 connection keep alive logic into a separate configurable class.
Can you add the licence hearder to both new file, with a small description of what the class is doing? Thanks!