New Zealand offers to buy 5,000 quake-hit homes