A security flaw in YouTube made it possible to view email addresses for any account on the platform, but it has been fixed.