Foreign nationals would lose their right to social housing in the UK under a Conservative government, the party has said.