Error free error handling for badges

Summary: I have to say that I have not thoroughly tested error handling in badges dashboard. Hence, I have not thought about all possible states. First of all there is a possibility that error occurs on initial page load then the $.magnificPopup.instance is null and whole routine fails due to error in the first line. Secondly if there is an error in loading overall badge summary but the popup instance is not null the loader has not been turned off correctly. I am going a bit hard on errors here since I remove all data on error but without connection or connection that errored out it is doubtful that dashboard will be as useful as it ought to be. Currently errors should be handled correctly and ui will recover from error states in a proper way.

Test Plan: errors in badges dashboard should not cause more errors

Reviewers: chris, jace

Reviewed By: chris

Differential Revision: http://phabricator.khanacademy.org/D2732