WebRequest::getIP() cleanups.

* Always treat the first XFF IP from cache proxies as sane
  even if it is a private IP (useful for things like labs wmf).
* Make sure IP::canonicalize() gets called if the IP is selected
  from the XFF chain (this matches getRawIP()).
* Altered and expanded unit tests.

bug: 48919
Change-Id: I350aca72c7a96ba3ec727324800612fc84e0e7a4
(cherry picked from commit 8bd6922ab0b1f9a317dc1912d97257112bc90ece)