Use wfWikiID() instead of $wgDBname

Change-Id: If5ffd7e55cfce92126b977df3e3321ecd058e689