Boston’s commercial and residential real estate markets experienced turbulence in 2022 as construction and other costs spiked and clouds gathered on the economic horizon.