Register NS_ZERO early if running on configuration wiki

The point at which $wgExtensionFunctions are executed is too late for
registering additional namespaces. Defering the registration of the namespace
until then can lead to unpredictable results, as documented in bug 45031. The
solution is to register the namespace early by binding the CanonicalNamespaces
hook handler at file scope and checking there if the wiki should activate the
extra namespace or not. Namespace permissions and content handlers can be
configured at unconditionally at file level since they do not require the
namespace to actually be created.

Bug: 45031
Change-Id: I2fb2bcaa2108dd40a5374505ee5a9d8845e6e1d8