Taiwan president quits as party chair after local election setback