The speaker made a last-minute reversal to avert a government shutdown. It could cost him his job. For weeks, Speaker Kevin McCarthy seemed to face an impossible choice as he haggled over spending bills with his party’s most hard-line members: He could keep the government open, or he could keep his …