http: prefer `createConnection` over `agent`

If the `createConnection()` function is given as an http
option, then prefer invoking that to create the connection
instead of using an `http.Agent` instance.

Fixes #7014.