fix for reassignment with bad index ref + test

this also removes duplicate case blocks from reassignment submission

http://manage.dimagi.com/default.asp?82824

dependent on https://github.com/dimagi/casexml/pull/134