President-elect Donald J. Trump had already signaled his intention to replace Mr. Wray with a longtime loyalist, Kash Patel.