Optimize public_trial upgrade steps so we only rebuild indexes once.
Fix mail upgrade steps so they can safely be run a second time.

Also deal with the broken tuple schema when setting defaults.
Use the same customized download view we use for documents for mails as well.