Replace usage of inet_ntoa() with getnameinfo()

It's threadsafe and protocol independant.

Also removed a couple of possible silent-truncation bugs.
platform.h: put all system includes on top

Also fix some confusing indentation. And removed "#define __USE_GNU". This is
internal to glibc and should never be used, _GNU_SOURCE should be enough if
properly defined before all includes.
Include assert.h centrally in platform.h.
Added some debug messages and silenced a couple of warnings.
Simplified some braindead logic, added comments.
ScopeDeleteSpecial() is unecessary before ScopeNewSpecial()

...pinpointed by the latest WARN messages.
Fix regression of setting VIPADDRESS to 127.0.0.1

See redmine #3010, now it's set to the first address of non-loopback
interface.
avoid testcase failure in non-debian env
Merge pull request #790 from kacfengine/ubuntu_test_failure

avoid testcase failure in non-debian env
Fix symlinks being destroyed when editing them.

With this fix we dereference the link and edit the pointed-to file
instead.

Fixes issue 2363.
Merge pull request #770 from jimis/bug3010

Bug3010
Merge pull request #791 from kacfengine/issue-2363

Fix symlinks being destroyed when editing them.
Fixes redmine #2861 : deleting inexisting package should be marked as KEPT
Acceptance test for removing a package that does not exist / not installed
Add a unit test for MatchRegion in item_lib.c.
Merge pull request #794 from kacfengine/match_region_unittest

Add a unit test for MatchRegion in item_lib.c.
Merge pull request #772 from jeffali/temp/2861-delpkg

Fixes redmine #2861 : deleting inexisting package should be marked as KEPT