The US Senate has confirmed Pam Bondi as US attorney general, giving longtime Trump ally power to reshape the Justice Department.