The sheriff shall have the charge and custody of the jails of his county, and of the prisoners in the same; and shall keep them himself, or by his deputy or jailer.