Fix a JS issue when the anchor element on a page has no container
Summary: See D21213. If there's no matching element, findAbove() throws. Handle these cases correctly.
Test Plan: Visited #toc on a revision, no longer saw a JS error.
Differential Revision: https://secure.phabricator.com/D21222