Carpenters sidestep Hudson Yards legal battle, reach agreement with Related Cos.