A duly appointed agent to receive, in behalf of the United States, the delivery, by a foreign government, of any person accused of crime committed within the United States, and to convey him to the place of his trial, shall have all the powers of a marshal of the United States, in the several districts through which it may be necessary for him to pass with such prisoner, so far as such power is requisite for the prisoner’s safe-keeping.