Confirming her departure in a post on X, Katie Zacharia said it had been “an honour” to serve as White House Press Secretary