Require bigdecimal before monkey-patching it

If we try to monkey-patch the class before requiring it, then a
"superclass mismatch" (TypeError) error is raised and the build can't
run correctly.

Fixes #12708
Merge pull request #12710 from robin850/fix-build

Require bigdecimal before monkey-patching it