utils: do not call freeaddrinfo if NULL argument (FreeBSD doesn't like it)

refs #2137

Change-Id: Iad3ddfb7aefb426663d036ec2c510cd7447f8fc4