Improve detection of client IP address

Check for more `$_SERVER` headers and take just the first IP address if
there are multiple values.