Walmart Associates Inc. settled a lawsuit brought by a former worker alleging he was unlawfully fired after requesting accommodations for his mental health disorders.