Fix Klocwork errors in liblight