Netflix added 5.9 million new subscribers in its second quarter after it cracked down on password sharing.