libkml: fix compilation with clang and gcc 4.7+

Fixes #24069.