Ms. Warren used an unannounced appearance on Wednesday to confront a political liability before a potential bid for president.