The U.S. Department of Justice and state of Alabama on Monday agreed to settle a long-running lawsuit alleging that the state’s prisons are unconstitutionally filthy, unsafe and violent.