Make preindex fail loudly and finish only when views are done reindexing

depends on https://github.com/dimagi/dimagi-utils/pull/198

It's not 100% clear that the emails don't lie, so I didn't change the email message yet. Preliminary testing was promising but a little confusing, possibly due to multiple people doing things at the same time.