[Flang] Use PrintModulePass to print LLVM IR from the frontend (#95142)

The Flang frontend currently prints LLVM IR modules using
llvm::Module::print(); this works for default cases, but skips some of
the logic that IR printer passes use, specifically the use of the
--write-experimental-debuginfo flag to control debug info format. This
patch replaces the use of print() with the PrintModulePass, bringing the
printing behaviour to parity with clang's frontend.
14 jobs for main
in 0 seconds and was queued for 0 seconds