West Indies signed off their ICC World Cup campaign with a 23 run win over Afghanistan, in what was potentially Chris Gayle's final match in the competition.