Merge klib upstream.

upstream changes in klib: https://github.com/attractivechaos/klib/commit/f79c9162ee00a5d123ad8096b1143dd071dd0578