backport of !64504 (merged), to fix breakage with libapk from apk-tools-2.14 (see also #11001 (closed))