properly redirect searches for XFormInstance-like documents
don't fail hard rendering forms where .form is None
Merge pull request #4889 from dimagi/form-search

properly redirect searches for XFormInstance-like documents