Man accused of threatening president appears in court