Locked for weeks or months in solitary cells, mentally ill and vulnerable detainees are plagued by anxiety, anger, depression, and suicidal impulses.