Protect case where otimize_module is called with not function active.
(This is happening for an empty function but with PTX codegen being
called somehow.)