Trump loyalist steps down as US attorney after judge’s rebuke