A ban on foreigners buying residential property in Canada took effect, aiming to make more homes available to locals facing a housing crunch.