Fix issue in Ubuntu where multiple loopback addresses are used

A vanilla installation of Ubuntu has 127.0.0.1 and 127.0.1.1 defined
as the loopback address in /etc/hosts. In some cases, Java will
use each interchangably, hence an equals comparison will return false.