Store directory_pages data in the persistent cache.

This information is needed during every bootstrap, yet rarely changes, so there
should be significant performance benefit from caching it.

Invalidation takes place when one of the pages is updated, or when the bp-pages
option is changed.

Note that this change will likely be moot after migrating to the WP rewrite
API. See #4954.

See #5362

Props Denis-de-Bernardy

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7809 cdf35c40-ae34-48e0-9cc9-0c9da1808c22