wgHooks['SpecialVersionVersionUrl']: support alpha version

The beta environment has version strings like `1.25alpha`. The previous
SpecialVersionVersionUrl hook code does not match this version and leads
to generated urls like <https://www.mediawiki.org/wiki/MediaWiki_/wmf>
and PHP/HHVM warnings like "Notice: Undefined index: 1 in
/srv/mediawiki/wmf-config/CommonSettings.php on line 2906".

Change the version extraction regex to make the "wmfN" suffix optional
and guard use of the regex matches to avoid warnings when the version
string does not match.

Change-Id: I1af4c95172abeae3ce57f1bf825eae94e26e7848