FunMC: Support more Loaders in the dynamic rewrite system.
FunMC: Support more Loaders in the dynamic rewrite system.

In particular, this supports the custom Loader pytest installs.

Means to this end: relying on the spec produced by `importlib.util.find_spec`
for information as to whether we are dealing with a package and for the
original file name, instead of trying to obtain this information from
the Loader's methods.

PiperOrigin-RevId: 325928289

tensorflow/probability,tensorflow/probability