The officer or person executing a Governor's warrant of arrest under this division or the agent of the demanding state to whom the prisoner may have been delivered may confine the prisoner in the jail of any county or city through which he may pass when necessary. The keeper of such jail must receive and safely keep the prisoner until the person having charge of him is ready to proceed on his route, such person being chargeable with the expense of keeping.