As mental health care falters, jails and prisons get stuck