cos_loader: fix is_loaded_by_boot_layer() check