Rising costs for construction materials could make it harder to address Massachusetts’ affordable housing shortage.