[aot] Fix a crash in the aot cache code if MONO_LOG_LEVEL is set.