Cleanups, including platform.h in cf-upgrade, and linking it to libcompat.

Fix in https://github.com/cfengine/core/commit/1876a215a2740480f15ddfbf10f381e75aaea126.