Sales of previously occupied homes rose in October, the first annual gain in the U.S. in more than three years