Move forceHTTPS check until after wgTitle is setup

Since the forceHTTPS logic checks if the user is logged in, which calls
all sorts of hooks, some that assume that $wgTitle is setup (like
AbuseFilter for preventing autocreation of usernames), move the
logic down a few lines.

Bug: 55435
Bug: 53498
Change-Id: I53c82921595a9014b555e4ec468e5ba10454cd3a
(cherry picked from commit 0adbbacb0ad94ca14c8bf96df2fdcd0f153e8f6e)