[modules] fix double free - when loading modules, the module name should be stored