Clear record when doc_type was changed

@czue http://manage.dimagi.com/default.asp?140716#785508
This assert will bypass the check below in `_is_doc_type_deleted_match`