Minor cleanup.
Fix #18930 -- Force a 404 for obsolete documents.

This relies on Document objects being properly deleted when they're
obsolete. The code is designed to do that but I've observed it doesn't
work as expected: duplicate objects get created.