A hacker’s invasion of dozens of celebrity iCloud accounts, leading to the embarrassing leaking of nude photos, has lessons for us all.