fix bug 999102: Respond with 404 for $history where document has no revisions
Merge pull request #2315 from lmorchard/999102-history-error

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