Introduce a ms_site_not_found filter to replace NOBLOGREDIRECT.

Move some processing down below the point where we bail if there's no site. Add more documentation.

props jeremyfelt.
fixes #21143, see #27003.

Built from https://develop.svn.wordpress.org/trunk@27663


git-svn-id: http://core.svn.wordpress.org/trunk@27506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Multisite load: Cache the main site lookup query.

props jeremyfelt.
see #27003.

Built from https://develop.svn.wordpress.org/trunk@27664


git-svn-id: http://core.svn.wordpress.org/trunk@27507 1a063a9b-81f0-0310-95a4-ce76da25c4cd