Americans bought more homes in June, the fourth straight monthly gain as the sales rate reached its highest level in more than nine years.