Fix a couple regressions in the diff viewer.

This fixes two regressions, one new, and one that's been around since
the rewrite.

The new one blocks viewing unpublished diffs. The template code setting
up the diff-related models was assuming the existence of the
latest_diffset object, which didn't exist in this case. The result was
that no value was outputted, leading to invalid JavaScript, which
prevented any diffs from loading.

The second was a visual glitch that resulted in an extra ">" before the
expand links for headers. This was due to the ">" being after the wrong
endif tag.