[3.13] gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952) (#122984)

gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952)

As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working.  This is a minimal fix just to get builds working again.  There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately.
(cherry picked from commit ee1b8ce26e700350e47a5f65201097121c41912e)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
5 files changed