Todd Blanche has been sworn in as US attorney general after a bruising confirmation fight that ended in a narrow Senate vote.