Fix MODULES_LOADED_ON_BOOT migration, handle unset variable