[PATCH v2 44/50] image: Reduce variable scope in boot_get_ramdisk()