Decrease the number of duplicate queries during a single pageload for Widget Visibility.

Store the results of in-page widget visibility condition checks so they can be reused within the page or other widgets with the same conditions.

This should have an immediate effect even for pages with only one widget, since the checks are run twice to determine if the sidebar has any existing widgets before the sidebar itself is shown.

See #1377