The sale of one of Los Angeles’ largest collections of homeless housing was approved by a judge Wednesday, marking a final step in averting a catastrophic loss of permanent shelter in Skid Row.