Legality and morality are rising issues for architects who design solitary-confinement cells and death chambers.