Fix a use-after-free bug I recently introduced in lookupModuleFile