registry: refactor registry.IsSecure calls into registry.NewEndpoint

Signed-off-by: Tibor Vass <teabee89@gmail.com>

Ping @dmcgowan @proppy @vbatts 
actually, this won't be good. hostname now is URL.Host, not the `https://index.docker.io/v1/` returned by `IndexServerAddress()`