England clinched a series win over West Indies with two games to spare after a nervy three-wicket victory in St Lucia.