Fix build with libkgapi >= 5.12 (aka Applications/19.08)
This is a backport of 01ec4d87b2e28d + f81aed7bd13fd1d