Add management command to find domains impacted by 502 bug

http://manage.dimagi.com/default.asp?126120
Sorry for the ongoing slow review here...

Would it make sense to `break` out of this loop, and actually break all the way up to `for app in ...`, on finding a match here? Seems like that might save quite a bit of time.