Taiwan president resigns as ruling party leader after local election loss