Fix bug in determination of public ips.

On some systems, the output of ifconfig contains:

   addr:127.0.0.1

rather than simply 127.0.0.1. This patch detects when this is the case
and corrects for it if necessary.
Use `startswith` instead of `in`
Merge pull request #4749 from porterjamesj/ip-fix

Fix bug in determination of public ips from Linux ifconfig