Beds and mattresses for treating pressure ulcers