Federal government closes tax loophole used by foreign homebuyers, hikes mortgage scrutiny