The Senate confirmed Kash Patel to serve as director of the FBI, approving a key ally of President Trump to lead the bureau.