Netflix topped Wall Street expectations in the second quarter, boosted by strong subscriber growth, rising ad revenue, and hit content.