Clear record when doc_type was changed

@czue http://manage.dimagi.com/default.asp?140716#785508
this is doing a class level assert that `self.doc_type` and `self.deleted_types` don't contradict each other on the class. `_is_doc_type_deleted_match` checks the doc instance so I think it's ok?