Improve detection of client IP address

Check for more $_SERVER headers and take just the first IP address if
there are multiple values.
Merge pull request #882 from mlocati/improve-ip-detection

Improve detection of client IP address