Set up security enviornment much earlier

Basically there's a log line that says "Starting processing of request from..."
which had the wrong IP because we did not yet have the XFF stuff set up
correctly at that point.

Change-Id: Ibc6ed2c4a8f5ce68d1caae90fe5cd96e2cb4c0c4