The Boston City Council approved a measure allowing the city to opt in to a state law offering tax breaks for landlords who keep rents affordable.