Always load net/https before referencing related constants

I put this require inside the method body, because eager-loading
net/https is slow compared to the rest of Homebrew, and utils.rb is
loaded for each `brew` invocation.

It's probably worth breaking up global.rb a bit, to reduce the amount of
code we are loading unnecessarily, but hopefully also to make inter-file
dependencies a bit more obvious.

Fixes #21617.