Perú, Cuba y la lucha por la libertad en América Latina