"The decision to detain a person before he is found guilty of a crime, whether made by an arresting office, prosecutor, or judicial officer, can have a severe, lasting, and adverse impact. Pretrial detention is one of the worst things that can happen to a person: the detainee immediately loses his freedom, and can also lose his family, health, home, job, and community ties."