fix bug 999102: Respond with 404 for $history where document has no revisions

This doesn't address how some docs happened to have no revisions, but it at least fixes the error. Luckily there are only 3 docs in this state, [as far as I can tell](https://bugzilla.mozilla.org/show_bug.cgi?id=999102#c3).