Cleanup command for IPM domain

http://manage.dimagi.com/default.asp?147063
`except Exception` is recommended over bare `except`.