Fix uninitialized constant error in GitHub.open

The error handling depends on side effects of `require "net/https"`,
so it should be wrapped in an explicit begin block.

cf. #30407.