Charges against Bergdahl referred to trial by court-martial