U.S. home sales rise as consumers register more optimism