[runtime] Fix a crash in the logging profiler when enumerating elf images.