Before trading it to Spain, how did Britain acquire Cuba?