Convert load-time exception into requirement

We can't raise exceptions from the class body. Doing so means there are
circumstances where the formula can't even be loaded.

Fixes Homebrew/homebrew#34821.
Move load-time exit into install method