Ensure MediaWiki has been cloned before cloning extensions

If an extension is cloned into mediawiki/extensions before mediawiki-core has
been cloned into mediawiki/, the subsequent attempt to clone mediawiki-core
will fail, since git declines to clone into an existing directory if that
directory is nonempty. This patch ensures that core is cloned before any
extensions.

Bug: 54008
Change-Id: I14ef09ca8ee9058f703bec55ca0cf0c1812fa136