SAN FRANCISCO — For more than a decade, Google’s search advertising business has seemed almost magical in its ability to mint money. But the magic is beginning to wear off as people spend more time on mobile devices, where the company makes less money on ads.